Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-22815: Variable is not computed correctly on subwikis #3877

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
##!unique=request
#template("frequentlyUsedDocs.vm")
#set ($isGuest = $xcontext.getUser().equals('XWiki.XWikiGuest'))
#set ($isSuperAdmin = ($xcontext.user == 'XWiki.superadmin'))
#set ($isSuperAdmin = ($xcontext.user == 'XWiki.superadmin') || ($xcontext.user == "${services.wiki.mainWikiId}:XWiki.superadmin"))
Copy link
Member

@tmortagne tmortagne Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like we should stop have any kind of logic in this template and instead call some Java API which check that as it's supposed to be checked, in a single common location (for example, what your new version is doing is still quite different from what the authorization manager is doing which is currently what should be the reference).

## 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
Expand Down