[TYPO3-mvc] FYI: security view helpers backported

Bastian Waidelich bastian at typo3.org
Mon Sep 20 18:43:49 CEST 2010


Hey you,

I just "backported" the security view helpers ifAuthenticated and 
ifHasRole. You can use them as follows:

<f:security.ifAuthenticated>
   this is only shown if a FE user is logged in
</f:security.ifAuthenticated>

<f:security.ifHasRole role="Editor">
   this is only shown if a FE user is logged in and
   belongs to a FE usergroup titled "Editor"
</f:security.ifHasRole>

instead of role="Editor" above you can also specify the uid of the 
corresponding usergroup. But using the title is "forward" compatible as 
in FLOW3 you'd always use the name of the role.

You can also use <f:then> and <f:else> within the security.* view 
helpers just like in <f:if>

If you want to work with BE users/groups use the corresponding 
be.security.* view helpers.

Have fun
Bastian


More information about the TYPO3-project-typo3v4mvc mailing list