/ Published in: HTML
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<g:isLoggedIn> Only logged users (no matter witch roles) will see this text. This is useful to build the "Welcome ..." text and the logout link! </g:isLoggedIn> <g:isNotLoggedIn> Only anonymous users will see this. This is nice to build your "login" or "registration" link! </g:isNotLoggedIn> <!-- Let's pretend we are logged as our 'god' user --> <g:loggedInUserInfo field="username"/> <!-- will show 'god' --> <g:loggedInUserInfo field="email"/> <!-- will show '[email protected]' --> <g:loggedInUserInfo field="userRealName"/> <!-- will show 'god almighty' --> <g:ifAllGranted role="ROLE_ADMIN,ROLE_USER"> This information will be available for admins whom have the ROLE_USER associated either. </g:ifAllGranted> <g:ifAnyGranted role="ROLE_ADMIN,ROLE_USER"> This information will be available for any logged admin or user. </g:ifAnyGranted> <g:ifNotGranted role="ROLE_ADMIN"> All sessions that have the ROLE_ADMIN associated will not see this message! </g:ifNotGranted>