User contribution and page permission inheritance

Jon White asked on October 2, 2015 17:30

Hi there,

I'm trying to figure out how i can restrict users from editing pages/documents based on the permissions of the parent page.

So the user contribution has options for 'allow editing by users' of 'ALL, AUTHENTICATED, PAGE OWNER'.

This is ok, but what if it to be edited to select roles who I have set in the parent page security setting.

For example:

I have a parent page with 'edit' permission for one role(department) say 'reception'. I have a page as a child beneath it which is a document type of CMS.News that when added by a user is editable by members of only the same role(department) or 'reception'.

The CMS.News uses a global template so i need it to only be editable by the roles i've selected at parent level (needs to be relative as it's the same template used under various parent pages)

I can't understand what i'm doing wrong, is there a macro that can make the 'edit/delete buttons' dissapear such as : "currentuser has parent page permission of 'modify'"?

Sorry i'm probably being stupid.

I'd be grateful for any assistance Thanks Jon

Recent Answers


Joshua Adams answered on October 5, 2015 16:46

As long as you wrap your buttons in the macro condition checking the parent, I can't see why that wouldn't work. Although, off the top of my head, Im not sure if there is a condition for checking if a user is authorized for a node. All I see in the current user macro for permissions is authorized per resource, and authorized per ui element. Not sure how your pages are all set up, so maybe one of those could work, but worst case, you can create a custom macro that will return exactly what you need, and use that to determine if the buttons should show or not. If you don't want to do that, then maybe you can figure out a way to use the memberships if they aren't already used for something. There are macros that are built in for checking the current users membership. Just a thought.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.