Visible / Hide macro based on parent permission

Jon White asked on April 1, 2015 14:01

Hi there,

I want to display something based on role (editable text/repeater), in the 'visible' box I've used a macro of:

{%(CurrentUser.IsInRole("communications"))#%}

This works but I don't want to edit this each time we amend roles.

The parent page set the permission and this page will inherit it so is there a way to edit this macro so it hides/shows by inheriting the parent permission?

Thank you in advance Jon

Recent Answers


Joel Dahlin answered on April 1, 2015 23:40

In other words you want to look at the Parent Visible property and inherit the value of that to the current page where your parent page Visible property would have the macro, is that right?

I don't think you can do that. However what you could do is create a new macro and insert it on the Visible property for all pages. Something like "IsMySectionVisible()" and in the IsMySectionVisible macro you could have the logic of what roles are allowed to view something.

Alternatively I think it would be best to just re-think your roles and create a role that only these pages can view and move users in and out of that role. A user can belong to multiple roles.

0 votesVote for this answer Mark as a Correct answer

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