Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ian Robinson 79 posts 143 karma points
    Feb 05, 2018 @ 16:01
    Ian Robinson
    0

    Umbraco permissions for child nodes

    Hi,

    In the latest Umbraco (7.7.9 at the moment), in the backoffice I want a user group, say editors, to be able to create, update and delete nodes in the content section under a parent node, but not allow them to delete that parent content node.

    So for example, if I have website called "Best Website Ever" and underneath this is a series of web page nodes as well as a node called "Blog", and inside blog are lots of child "Post/Article" nodes, can I set the permissions to allow editors to add and remove web page content nodes and Post nodes but stop them from accidentally deleting the "Blog" node?

    I had a client who did this once, and they accidentally deleted all the child "Post" nodes.

    When I remove their permission to delete the blog node, it stops them from being able to delete any child Post nodes. I want them to have the power to create and delete individual Post nodes but not the parent Blog node.

    Is this possible via the back office in Umbraco or do I need to hook into the save event for the Post node and re-enable the delete permission using code?

  • Sotiris Filippidis 286 posts 1501 karma points
    Feb 05, 2018 @ 21:12
    Sotiris Filippidis
    0

    Isn't the delete permission for a node automatically given to people that have "create" permissions on the parent node, in your case users who can create blog posts? As far as I can assume, if someone creates a new blog post they can also delete it, even if they haven't got rights to delete the parent node.

    If your issue is with existing nodes, though, maybe you should try going the hard (manual) way:

    • Remove delete permissions from parent node (blog node).
    • Go and explicitly enable delete permission for each blog post (in one go, of course).

    I'm not exactly sure that this is helpful since I've done it in previous Umbraco versions only (before 7.6) and obviously for a single user. But I think that the concept remains the same for groups.

  • Anna 12 posts 122 karma points
    Sep 11, 2018 @ 12:31
    Anna
    0

    Hi Ian,

    I guess I have the same issue. I need to have very limited permissions for domain node, but more permissions at child nodes and it seems it's not possible either without custom control or Umbraco adding some extra functionality for that.

  • Ian Robinson 79 posts 143 karma points
    Sep 11, 2018 @ 14:02
    Ian Robinson
    1

    Hi Anna,

    I never found an easy solution built into Umbraco.

    Sotiris's solution would work I think but you would need to explicitly enable the delete permission each time a blog post was created, by either manually doing this in the back office, or writing some custom backoffice code that runs when the blog post create event fires.

    An alternative solution which I prefer is something I've come across when using some uSkinned themes (https://uskinned.net/).

    In these themes, uSkinned give some nodes (document types) a "Do not allow deletion" property. This is a yes/no switch or radio button and is set to true (yes) by default. Then there's some generic code in the back office which you write to fire before this node is deleted. This code checks if the node has a "Do not allow deletion" property and if it does and if it's set to true, then it cancels the deletion action. Sp the user must set this property to false, do a save and then do a delete, in order to delete that node.

    That's how I believe it works anyway. I haven't gone through the code line by line.

    So this solution wouldn't allow you to completely stop different user groups from deleting parent nodes while still being allowed to delete that parent's child nodes, but it does stop the user from accidentally deleting a parent node and all it's children. It's an extra check and works in my use case.

    I hope that helps?

Please Sign in or register to post replies

Write your reply to:

Draft