modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 529 forks source link

Feature request: Disable moving resources for specific usergroups #13596

Open joeke opened 7 years ago

joeke commented 7 years ago

For some resources I want to be able to disable changing the parent ID (drag/dropping via tree and via the Settings tab on the Resource edit screen). The user should still be able to edit/publish the resource etc., just not be able to move it (change the parent ID). At the moment it's only possible via ACL to disable editing altogether, but I would like to have an extra policy item in the ACL ('change_parent' or something) so this can be achieved with Resource Groups. When the rule applies, disable the drag/dropping of the specified resource in the resource tree, and disable the 'Change parent' field in the Resource Settings tab.

OptimusCrime commented 7 years ago

I think this idea is good, but I am unsure how it would work when you move larger groups of resources.

Say you have the following tree:

- A
-- B
--- C
- D

Where you disallow the user to change parent of C. Would you then allow to move B from A to D? It does not change the parent of C directly, but the hierarchy is changed.

I could be interested in developing a PoC for this with some help, if you are up for the challenge?

joeke commented 7 years ago

@OptimusCrime That indeed is a tricky situation. I believe that in your example the moving of B should be allowed. If you really don't want B to be moved, make sure all parents are protected from moving as well (for example by placing them all in the correct resource group). Our main use case is a client who wants to protect users from (accidentally) moving around important top level pages (home, contact, products, shopping cart etc.), but does want full editing capabilities.

OptimusCrime commented 7 years ago

I agree. I'll see if I can look closer at this some time soon.