Role Permits

From SocialStack
Revision as of 16:04, 26 April 2024 by Ablewhite (talk | contribs)

Role permits are a mechanism which allow any content to be visible based on role. This is most frequently used by pages to make multiple variations of a page. The page displayed to the user is ultimately the one which the permission system selected for them.

This is useful for multiple reasons: Firstly, it allows you to use the editor for each role variation of the content. You don't need to try and be in the context of a given role when making changes to a page, for example. Second, the content for other roles is not present in the source of the page, keeping that content safer if it is, for example, paid for content.

Role permits are not active for content by default. You must make use of them in your permission rules with "HasRolePermits()". This also means you can use them as part of a more complex permission rule, or invert it if you want your list of roles to represent *excluded* roles:

!HasRolePermits()