Changes for page Scripting
Last modified by Mohammad Humayun Khan on 2021/07/22
Change comment:
added example for using some velocity vars
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -112,9 +112,9 @@ 112 112 #set($docextras = []) 113 113 {{/code}} 114 114 115 -=== Current userinformation===115 +=== Information about the current user === 116 116 117 -The following variables (set in the [[xwikivars.vm>>http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/standard/src/main/webapp/templates/xwikivars.vm]] template) are **shortcuts**for checking various information **for the current user**:117 +The following variables (set in the [[xwikivars.vm>>http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/standard/src/main/webapp/templates/xwikivars.vm]] template) are shortcuts for checking various information **for the current user**: 118 118 119 119 * ##$isGuest##: checks if the current user is ##XWiki.XWikiGuest## 120 120 * ##$isSuperAdmin##: checks if the current user is the special user ##superadmin## ... ... @@ -134,9 +134,18 @@ 134 134 135 135 * ##$isAdvancedUser##: advanced users: ##superadmin##, users with the ##usertype## property set to "Advanced", guest users with admin rights 136 136 137 +Example: 138 +{{code}}{{velocity}} 139 +#if ($hasAdmin) 140 + ## This link will only be visible to users that have admin rights on this document 141 + [[Do some admin action>>Some.Document]] 142 +#end 143 +{{/velocity}}{{/code}} 144 + 145 + 137 137 === Information about the current wiki === 138 138 139 -The following variables (set in the [[xwikivars.vm>>http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/standard/src/main/webapp/templates/xwikivars.vm]] template) are **shortcuts**for checking various information **about the current wiki**:148 +The following variables (set in the [[xwikivars.vm>>http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/standard/src/main/webapp/templates/xwikivars.vm]] template) are shortcuts for checking various information **about the current wiki**: 140 140 141 141 * ##$isReadOnly## 142 142 * ##$isInServletMode##