Copied to clipboard

Flag this post as spam?

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


  • Darren Welch 23 posts 136 karma points c-trib
    Jul 06, 2017 @ 12:17
    Darren Welch
    0

    Giving user permissions

    Hi, I was just wondering if this is possible. It seems that user permissions have to be revoked, as opposed to being granted?

    I'm using version 7.2.8.

    This is a rough mockup of my node tree.

    • home
      • about
      • courses
        • london
          • course 1
          • course 2
        • new york
          • course 1
          • course 2
          • course 3
        • singapore
          • course 1
          • course 2
          • course 3
      • another node
      • yet another node
        • child node needing permission

    Each user needs access to 1 course region e.g. London and also "child node needing permission".

    1) Does this mean I need to set "start node" as home, revoke all permissions from "home" node (including children) Then just add permissions to the relevant pages?

    2) I also assume if someone adds a new page, that these users will now have access to this new page in their node tree until it is revoked?

    3) Is there a way to give permissions to specific pages only? Everything else is denied by default?

    Thanks for any help.

  • Aristotelis Pitaridis 84 posts 402 karma points
    Jul 07, 2017 @ 07:33
    Aristotelis Pitaridis
    0

    Hello Darren,

    I will tell you what I do when I have similar situations. I create a node for each user who may create or edit nodes. I set the start node for the user to be his personal node. The user can create new node inside his personal node and I have a property which allows the user to select the categories which the new node will be associated with. For your example, the associated nodes will be London, New York and Singapore.

    This is not that easy because the nodes London, New York and Singapore are out of the user’s start node and you will have to create a custom property editor to allow the user to select one or more of these nodes.

    Kind Regards,

    Aristotelis

  • Paul Seal 524 posts 2889 karma points MVP 7x c-trib
    Jul 07, 2017 @ 11:49
    Paul Seal
    0

    I like Aristotelis's idea, however, if you create a node for each user and then the london, new york nodes under them, they will have the user's node in the url.

    Another way around this could be to intercept the saving of an item and get it to check if the current member has permission to edit this record.

    See this post for more information

    http://www.codeshare.co.uk/blog/intercepting-content-and-member-save-events-in-umbraco/

  • Aristotelis Pitaridis 84 posts 402 karma points
    Jul 07, 2017 @ 12:26
    Aristotelis Pitaridis
    0

    I do not like the idea to allow a user to see nodes and stop him when he tries to save the contents of a node. Another solution would be to extend my initial approach. The user node and the nodes under the user node will not have template so that they will not have a url. Then you can have an ApplicationEventHandler where you will catch the saving for specific node type and you will create programmatically a node under the London, New York and Singapore nodes which will be used for the url which will have a property with the associated node id so that you will be able to go and get the information in order to display them on the screen.

    • home
      • about
      • courses
        • london
          • Course 1 link
        • new york
          • Course 2 link
          • Course 4 link
        • singapore
          • Course 3 link
      • Users
        • John
          • Course 1
          • Course 2
          • Course 3
          • Course 4

    John will create Course 1, Course 2, Course 3, and Course 4. Each time that the user will create the node which will contain all the required information for each course, a node will be created programmatically under the London, New York and Singapore nodes which will contain the course node id property.

    This means that the /courses/London/Course 1 link will have a url but the /Users/John/Course1 will not have a url.

Please Sign in or register to post replies

Write your reply to:

Draft