Copied to clipboard

Flag this post as spam?

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


  • Tim C 161 posts 528 karma points
    May 20, 2016 @ 05:40
    Tim C
    0

    Prevent unpublish/delete of parent node

    I have been testing this package and it seems ideal for my needs.

    However, there seems to be one issue : to allow users to create documents, I need to give them edit access at the parent level, so the create option is visible and creates documents one level below (where I want them).

    However, this means they have access to unpublish (or worse, delete) the parent node.

    I could hide the ufe panel for edit at the parent node by javascript, but that's not very secure. Is there any other way around this?

    In other words, they should be able to create and edit child documents but not do anything to the parent.

    Thanks

    [update] I found out that you can control permissions by user at page level, so I can at least remove delete : but I need to allow 'publish' so users can self-publish the child nodes - but then they can still unpublish the root node, so this is still a problem.

    Is there any configuration I can do on this?

  • Kenn Jacobsen 133 posts 791 karma points MVP 4x c-trib
    May 30, 2016 @ 08:36
    Kenn Jacobsen
    0

    Hi Tim,

    Unfortunately not. The way this package works is tightly coupled with the permissions system in the Umbraco backoffice.

    You may be able to do something with dynamic styles to hide the buttons in UFE you don't want displayed at a given page?

    -Kenn

  • Paul Seal 524 posts 2889 karma points MVP 6x c-trib
    May 30, 2016 @ 13:10
    Paul Seal
    0

    You can achieve this quite easily if you follow this article http://www.codeshare.co.uk/blog/intercepting-content-and-member-save-events-in-umbraco/

  • Tim C 161 posts 528 karma points
    Jun 05, 2016 @ 13:22
    Tim C
    0

    Paul

    I think this is the answer

    Prevent creation or editing of content items which have a certain documentTypeAlias

    presumably I could extend this to include deletion and publishing/unpublishing events.

    Would this code work in the App_Code folder?

    My Umbraco installation is on a hosted web service, and I can't work with Visual Studio remotely.

  • Veronica Burd 76 posts 201 karma points
    Jun 05, 2016 @ 13:36
    Veronica Burd
    0

    Hi Tim,

    Yes, you can add handlers for delete and un/publish events in a class file in App_Code. I've done just that and it works a treat.

    HTH

    Ver

  • Tim C 161 posts 528 karma points
    Jun 07, 2016 @ 21:33
    Tim C
    0

    Thanks to both of you, this looks exactly what I need.

    Looks like the list of event handlers is here

    https://our.umbraco.org/documentation/reference/events/contentservice-events

Please Sign in or register to post replies

Write your reply to:

Draft