<
From version < 27.1 >
edited by Caleb James DeLisle
on 2010/08/10
To version < 28.1 >
edited by Marta Girdea
on 2010/10/26
>
Change comment: Documented some widely used variables defined in xwikivars.vm

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Caleb_James_DeLisle
1 +XWiki.marta
Content
... ... @@ -89,9 +89,9 @@
89 89  
90 90  == Other Velocity Variables ==
91 91  
92 -{{info}}
92 +{{warning}}
93 93  These variables can be used but are subject to change in the future.
94 -{{/info}}
94 +{{/warning}}
95 95  
96 96  {{id name="HControllingwhethertodisplayCommentsHistoryAttachmentInformationsectionsornot"/}}
97 97  
... ... @@ -112,6 +112,36 @@
112 112  #set($docextras = [])
113 113  {{/code}}
114 114  
115 +=== Current user information ===
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**:
118 +
119 +* ##$isGuest##: checks if the current user is ##XWiki.XWikiGuest##
120 +* ##$isSuperAdmin##: checks if the current user is the special user ##superadmin##
121 +
122 +* ##$hasComment##: checks comment rights on the current document
123 +* ##$hasEdit##: checks edit rights on the current document
124 +* ##$hasWatch##: checks if the user is authenticated and the watch service is available
125 +
126 +* ##$hasAdmin##: checks admin rights on the current document
127 +* ##$hasSpaceAdmin##: checks admin rights on the ##XWikiPreferences## document of the current space
128 +* ##$hasGlobalAdmin##: checks admin rights on ##XWiki.XWikiPreferences##
129 +
130 +* ##$hasCreateSpace##: checks edit rights on that page that does not exist, in a space that doesn't exist
131 +* ##$hasCreatePage##: checks edit rights on that page that does not exist, in the current space
132 +
133 +* ##$hasProgramming##: checks if the current user has programming rights
134 +
135 +* ##$isAdvancedUser##: advanced users: ##superadmin##, users with the ##usertype## property set to "Advanced", guest users with admin rights
136 +
137 +=== Information about the current wiki ===
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**:
140 +
141 +* ##$isReadOnly##
142 +* ##$isInServletMode##
143 +* ##$isInPortletMode##
144 +
115 115  = Groovy Specific Information =
116 116  
117 117  Currently all non Velocity scripting languages are only allowed for administrators of a wiki (or users having the 'programming' right).
... ... @@ -156,6 +156,7 @@
156 156  IP Address: $address{{/code}}
157 157  
158 158  = Python Specific Information =
189 +
159 159  You can run python code in XWiki just like velocity or groovy.
160 160  {{code language="python"}}{{python}}
161 161  print "The full name of this document is " + doc.getFullName()

Get Connected