.. include:: /Includes.rst.txt .. _typo3-fluid-security-ifhasrole: ====================================================== security.ifHasRole ViewHelper `` ====================================================== This ViewHelper implements an ifHasRole/else condition for frontend groups. Examples ======== Basic usage ----------- :: This is being shown in case the current FE user belongs to a FE usergroup (aka role) titled "Administrator" (case sensitive) Everything inside the :html:`` tag is being displayed if the logged in frontend user belongs to the specified frontend user group. Comparison is done by comparing to title of the user groups. Using the usergroup uid as role identifier ------------------------------------------ :: This is being shown in case the current FE user belongs to a FE usergroup (aka role) with the uid "1" Everything inside the :html:`` tag is being displayed if the logged in frontend user belongs to the specified role. Comparison is done using the ``uid`` of frontend user groups. IfRole / then / else -------------------- :: This is being shown in case you have the role. This is being displayed in case you do not have the role. Everything inside the :html:`` tag is displayed if the logged in FE user belongs to the specified role. Otherwise, everything inside the :html:`` tag is displayed. .. _typo3-fluid-security-ifhasrole_arguments: Arguments ========= .. _security.ifhasrole_then: then ---- :aspect:`DataType` mixed :aspect:`Required` false :aspect:`Description` Value to be returned if the condition if met. .. _security.ifhasrole_else: else ---- :aspect:`DataType` mixed :aspect:`Required` false :aspect:`Description` Value to be returned if the condition if not met. .. _security.ifhasrole_role: role ---- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` The usergroup (either the usergroup uid or its title).