Copied to clipboard

Flag this post as spam?

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


  • Robert Martine-McEvoy 24 posts 109 karma points
    Aug 20, 2015 @ 18:22
    Robert Martine-McEvoy
    0

    Umbraco 7 User Type Permissions per Doc Type

    Hello,

    We are looking at developing an Umbraco 7 permission solution that allows User Type permissions to be applied based on the doc type..

    For example:

    • "User Type A" has Publish Permission on all doc types.

    • "User Type B" has Publish Permission on "blog post" doc types and "job posting" doc types, but for all other doc types only has "Send For Approval"

    We know you can set permissions on a user per node basis via "User Permissions", but we would like something more programatic, based on the doc type.

    For example: Users of "User Type B" will only be able to publish nodes with the doctypes "blog posts" or "job postings". Everything else will need approval.

    We were previously accomplishing this in Umbraco 6 via adding custom buttons the Page Load Event for editcontent.aspx. However since 7 has moved to Angular, we are trying to find a replacement solution.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Aug 20, 2015 @ 19:22
    Nicholas Westby
    0

    Take a look at this: https://our.umbraco.org/projects/backoffice-extensions/user-group-permissions/

    Source code is here (latest branch is "upgrade-part-2"): https://github.com/Nicholas-Westby/usergrouppermissions/tree/upgrade-part-2

    It's a project started by a couple others that I finished to make it viable for Umbraco 7. Right now, it allows you to set permissions for nodes based on user types (rather than specific users). That gets you half of what you want.

    What would be awesome is if you could fork it to add the ability to set permissions per document type for specific user types. You can then subscribe to node creation events and use Umbraco's built-in permission system to apply the appropriate permissions at that time.

    You might also have to do some other things, such as preventing somebody who doesn't have an appropriate user type from creating nodes of a particular content type in the first place. That might be a bit more tricky.

  • Robert Martine-McEvoy 24 posts 109 karma points
    Aug 20, 2015 @ 19:39
    Robert Martine-McEvoy
    1

    Thanks for the reply Nick! I have already taken a look at some of this to familiarize myself with the workings of the User Service.

    What you describe here...

    You can then subscribe to node creation events and use Umbraco's built-in permission system to apply the appropriate permissions at that time.

    You might also have to do some other things, such as preventing somebody who doesn't have an appropriate user type from creating nodes of a particular content type in the first place.

    ...is kind of the path I'm going down at the moment. I never much cared for the way I accomplished this in 6 and I'd like to take advantage of Umbraco's built in system as much as possible this time.

    I'll let you know how it goes.

Please Sign in or register to post replies

Write your reply to:

Draft