Package

ViewHelpers

ViewHelper Documentation

security.ifHasRole

This view helper implements an ifHasRole/else condition for FE users/groups.

= Examples =

<f:security.ifHasRole role="Administrator"> This is being shown in case the current FE user belongs to a FE usergroup (aka role) titled "Administrator" (case sensitive) </f:security.ifHasRole> Everything inside the <f:ifHasRole> tag is being displayed if the logged in FE user belongs to the specified role.

<f:security.ifHasRole role="1"> This is being shown in case the current FE user belongs to a FE usergroup (aka role) with the uid "1" </f:security.ifHasRole> Everything inside the <f:ifHasRole> tag is being displayed if the logged in FE user belongs to the specified role.

<f:security.ifHasRole role="Administrator"> <f:then> This is being shown in case you have the role. </f:then> <f:else> This is being displayed in case you do not have the role. </f:else> </f:security.ifHasRole> Everything inside the "then" tag is displayed if the logged in FE user belongs to the specified role. Otherwise, everything inside the "else"-tag is displayed.

Arguments

role string

The usergroup (either the usergroup uid or its title).

ViewHelper Resources

Schema Resources