Permalink
Switch branches/tags
XCOMMONS-862 XWIKI-5059 XWIKI-7553 XWIKI-9074 XWIKI-9930 XWIKI-10309 XWIKI-10489 XWIKI-11162 XWIKI-11476 XWIKI-12623 XWIKI-13101 XWIKI-13380 XWIKI-14461 XWIKI-14647 XWIKI-14674 XWIKI-14808 XWIKI-14929-14930 XWIKI-14947 XWIKI-15091 XWIKI-15092 XWIKI-15648 action-webjars-modules bug-XWIKI-14963 feature-XCOMMONS-916 feature-XWIKI-12544 feature-XWIKI-13142 feature-XWIKI-14129 feature-alfresco-link feature-authorization-context feature-blog-visibility feature-bootswatch-3.3.7 feature-default-notifications-preferences feature-edit-comments feature-extension-index feature-filterable-activity-stream feature-flavor-filtering feature-jcache feature-language-picker feature-newmodel feature-notification-filter-preferences-storage feature-notification-filter-preferences-store feature-notification-tags-filter feature-notifications-app feature-notifications-default-filter-preferences feature-notifications-email-clean feature-notifications-email-revamp feature-notifications-filters-with-starting-date feature-notifications-for-activitystream feature-notifications-watch-user feature-notifications-watched-revamp feature-overwrite-children-on-create-from-template feature-portlet-3.5.x feature-protect-product-pages feature-repositorydepmanaement feature-rest-nested-spaces feature-rights-accessibility feature-sharepage-group feature-standardnewline feature-store-attachments-newstore feature-theme-editor feature-thumbnails feature-translated-datetool feature-user-messages-in-notifications feature-users feature-velocity2 feature-viewers-uix feature-wiki-members master misc-fix-fn-tests revert-473-automation revert-802-XWIKI-14038 stable-8.4.x stable-9.1.x stable-9.2.x stable-9.3.x stable-9.4.x stable-9.5.x stable-9.6.x stable-9.7.x stable-9.8.x stable-9.9.x stable-9.10.x stable-9.11.x stable-10.8.x stable-10.10.x velocity-tools-refactoring xwiki-15452 xwiki-15605 xwiki-platform-7.2 xwiki-platform-7.4 xwiki-platform-notifications
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
139 lines (138 sloc) 7.24 KB
#if (!$XWIKIVARS_VM)
#set ($XWIKIVARS_VM = true)
#template("frequentlyUsedDocs.vm")
#set ($isGuest = $xcontext.getUser().equals('XWiki.XWikiGuest'))
#set ($isSuperAdmin = ($xcontext.user == 'XWiki.superadmin'))
## Does the current user have edit rights on the current document
#set ($hasEdit = $services.security.authorization.hasAccess('edit'))
## Does the current user have admin rights on the current document
#set ($hasAdmin = $services.security.authorization.hasAccess('admin'))
## Does the current user have comment rights on the current document
#set ($hasComment = $services.security.authorization.hasAccess('comment'))
## Does the current user have the right to create a space in the current wiki. Since there's no Create right, we test
## this by checking the edit right on the current wiki
#set ($hasCreateSpace = $services.security.authorization.hasAccess('edit', $services.model.getEntityReference('WIKI')))
## Does the current user have the right to create a page in the current wiki and current space. Since there's no
## Create right, we test this by checking the edit right on the current space and current wiki
#set ($hasCreatePage = $services.security.authorization.hasAccess('edit', $services.model.resolveSpace('')))
## Does the current user have admin rights on the current wiki. We check for admin rights on the wiki preferences page.
#set ($wikiPreferencesReference = $services.model.resolveDocument('XWiki.XWikiPreferences'))
#set ($hasGlobalAdmin = $services.security.authorization.hasAccess('admin', $wikiPreferencesReference))
## Does the current user have programming rights
#set ($hasProgramming = $services.security.authorization.hasAccess('programming', $xcontext.userReference, $NULL))
## Does the current user have the right to create new wiki. We check for the create wiki right on the wiki preferences
## page.
#set ($hasCreateWiki = $services.security.authorization.hasAccess('createwiki', $wikiPreferencesReference))
## Does the current user have admin rights on the current space. We check for admin rights on the current space's
## preferences page.
#set ($spacePreferencesDocumentReference = $services.model.resolveDocument('WebPreferences'))
#set ($hasSpaceAdmin = $services.security.authorization.hasAccess('admin', $spacePreferencesDocumentReference))
#set ($hasWatch = $services.watchlist && $services.watchlist.isEnabled() && !$isGuest && !$isSuperAdmin
&& $xwiki.exists($services.model.serialize(
$services.model.createDocumentReference($xcontext.database, 'XWiki', 'XWikiUserWatchListSheet'), 'local')))
#set ($hasDashboard = $xwiki.exists($services.model.serialize(
$services.model.createDocumentReference($xcontext.database, 'Dashboard', 'XWikiUserDashboardSheet'), 'local')))
##
## Are comments, attachments, history etc. enabled?
##
#macro (retrieveSetting $settingName $settingValue)
#set ($settingValue = "$!{xwiki.getSpacePreference($settingName)}")
#if ($settingValue != 'false' && $settingValue != 'no' && $settingValue != '0')
#set ($settingValue = true)
#else
#set ($settingValue = false)
#end
#end
#retrieveSetting('showcomments' $settingValue)
#set ($showcomments = $settingValue)
#retrieveSetting('showattachments' $settingValue)
#set ($showattachments = $settingValue)
#retrieveSetting('showhistory' $settingValue)
#set ($showhistory = $settingValue)
#retrieveSetting('showinformation' $settingValue)
#set ($showinformation = $settingValue)
##
## Annotations are special, they can be hidden from the Page Elements administrative settings,
## and they can be disabled per-space from the Annotations administration category.
#retrieveSetting('showannotations' $settingValue)
#set ($showannotations = $settingValue)
#if ($showannotations)
## The general settings allow displaying the tab
#set ($showannotations = false)
#if ($xwiki.exists('AnnotationCode.AnnotationConfig'))
#set ($annotationConfigObject = $xwiki.getDocument('AnnotationCode.AnnotationConfig').getObject('AnnotationCode.AnnotationConfig'))
#if ($annotationConfigObject.getProperty('activated').value != 0 && !$annotationConfigObject.getProperty('exceptionSpaces').value.contains($doc.space))
#set ($showannotations = true)
#set ($annotationClass = $annotationConfigObject.getProperty('annotationClass').value)
#set ($annotationCount = $services.annotations.getAnnotations($doc).size())
#end
#end
#end
##
##
#set ($isReadOnly = $xwiki.isReadOnly())
#set ($spaceViewUrl = $spaceDoc.getURL('view'))
#set ($viewUrl = $doc.getURL('view'))
#set ($userObj = $!crtUserDoc.getObject('XWiki.XWikiUsers', 0))
## =====================================================================================
## Advanced users are:
## - super admin
## - user documents who have their usertype property set to "Advanced"
## - guest users who have admin rights (i.e. when the wiki is empty with no rights set)
## =====================================================================================
#if ($isSuperAdmin)
#set ($isAdvancedUser = true)
#elseif ($isGuest && $hasAdmin)
#set ($isAdvancedUser = true)
#elseif (!$userObj.getProperty('usertype').value)
#set ($isAdvancedUser = false)
#else
#set ($isAdvancedUser = ($userObj.getProperty('usertype').value == 'Advanced'))
#end
## ======================================================================================
## Compute list of spaces to blacklist so that simple users don't see them.
## TODO : replace this list by a hidden space feature.
## ======================================================================================
#if ($hasAdmin || $isAdvancedUser)
#set ($blacklistedSpaces = [])
#else
#set ($blacklistedSpaces = ['Import', 'Panels', 'Scheduler', 'Stats', 'XAppClasses', 'XAppSheets', 'XAppTemplates', 'XWiki', 'WatchCode', 'WatchSheets', 'XApp', 'WatchAdmin', 'Watch', 'ColorThemes', 'AnnotationCode'])
#end
#set ($parent ="<a href='$parentDoc.getURL()'>$escapetool.xml(${parentDoc.displayTitle})</a>")
#if ($tdoc)
#set ($headertitle = "<a href='$viewUrl'>$escapetool.xml(${tdoc.displayTitle})</a>")
#else
#set ($headertitle = "<a href='$viewUrl'>$escapetool.xml(${doc.displayTitle})</a>")
#end
#set ($skin = $xwiki.getSkin())
## Compute the copyright and evaluate its content with Velocity to allow users to put some scripts inside
#set ($copyright = "#evaluate($xwiki.getSpaceCopyright())")
#set ($xwikimode = $xcontext.getMode())
#set ($logredir = $escapetool.xml($xwiki.relativeRequestURL))
##
#if ($xwiki.exists('XWiki.MaintenanceInfo'))
#set ($maintenanceinfo = 'XWiki.MaintenanceInfo')
#elseif ($xwiki.exists('xwiki:XWiki.MaintenanceInfo'))
#set ($maintenanceinfo = 'xwiki:XWiki.MaintenanceInfo')
#end
## Check language option
#set ($languageparams = '')
#if ($xwiki.isMultiLingual() && ("$!{tdoc.realLocale}" != ''))
#set ($languageparams = "language=${tdoc.realLocale}")
#end
## Check revision option
#if ($request.rev)
#set ($revparams = "rev=$!{escapetool.url(${request.rev})}")
#else
#set ($revparams = '')
#end
#if ($revparams != '' && $languageparams != '')
#set ($docvariant = "$languageparams&amp;$revparams")
#else
#set ($docvariant = "${languageparams}${revparams}")
#end
#set ($keyboardShortcutsEnabled = $isAdvancedUser)
#set ($isInPortletMode = $xwikimode == 1 || "$!request.getAttribute('javax.portlet.request')" != '')
#set ($isInServletMode = $xwikimode == 0 && !$isInPortletMode)
#template("deprecatedVars.vm")
#end