mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) discount indirect changes for access control purposes
Summary: This diff discounts indirect changes for access control purposes. A UserAction that updates a cell A, which in turn causes changes in other dependent cells, will be considered a change to cell A for access control purposes. The `engine.apply_user_actions` method now returns a `direct` array, with a boolean for each `stored` action, set to `true` if the action is attributed to the user or `false` if it is attributed to the engine. `GranularAccess` ignores actions attributed to the engine when checking for edit rights. Subtleties: * Removal of references to a removed row are considered direct changes. * Doesn't play well with undos as yet. An action that indirectly modifies a cell the user doesn't have rights to may succeed, but it will not be reversible. Test Plan: added tests, updated tests Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2806
This commit is contained in:
@@ -40,6 +40,7 @@ def acl_read_split(action_group):
|
||||
bundle = action_obj.ActionBundle()
|
||||
bundle.envelopes.append(action_obj.Envelope(ALL_SET))
|
||||
bundle.stored.extend((0, da) for da in action_group.stored)
|
||||
bundle.direct.extend((0, flag) for flag in action_group.direct)
|
||||
bundle.calc.extend((0, da) for da in action_group.calc)
|
||||
bundle.undo.extend((0, da) for da in action_group.undo)
|
||||
bundle.retValues = action_group.retValues
|
||||
|
||||
Reference in New Issue
Block a user