The following tags render the body of the tag if the user has one of the roles indicated by the comma-separated list of role paths specified by the roles attribute.

A role test can be negated by prepending the role path with an exclamation point (!). The roles list specifies an “or” relationship. For example, if you set the roles attribute like this:

roles="member,!leader"

then the body will render if the user is either a member or not a leader. If a barrier attribute is specified, and its value is true, this will redirect the user to a login or access denied page rather than filtering the tag body content. Note that you shouldn’t use the barrier attribute within a gear, since redirection is not allowed within a gear.

hasRole

The hasRole tag tests for specified global roles. If the user is logged in and has one of the global roles defined by the roles attribute, the body of the tag is evaluated. If the user is not logged in, or does not have the role, the body is skipped.

Example:

[tag library declaration]
...
<dsp:page>
<paf:hasRole roles="/portal-admin,!/employees/sales">
...
[page contents]
...
</paf:hasRole>
</dsp:page>
hasCommunityRole

The hasCommunityRole tag tests for a specific role. If the user is logged in and has one of the roles defined by the roles attribute for the community, the body of the tag is evaluated. If the user is not logged in, or does not have the role for the community, the body is skipped.

Example:

[tag library declaration]
...
<dsp:page>
<paf:hasCommunityRole roles="leader,page-manager" barrier="true">
...
[page contents]
...
</paf:hasCommunityRole>
</dsp:page>
hasGearRole

The hasGearRole tag tests for a specific role. If the user is logged in and has one of the roles defined by the roles attribute for the gear, the body of the tag is evaluated. If the user is not logged in, or does not have the role for the gear, the body is skipped.

Example:

[tag library declaration]
...
<dsp:page>
<paf:hasGearRole roles="gear-reader,gear-writer" barrier="true">
...
[page contents]
...
</paf:hasGearRole>
</dsp:page>
 
loading table of contents...