This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-532d1b21-285d-4de4-aa88-0951de34aa58 XWIKI-22942 Open

isSuperAdmin is implemented in many different ways

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-d5a7ef3d-f043-41ee-a1ce-24e357ac998e Manuel Leduc created this issue on 27/Feb/25 16:50
 
Summary: isSuperAdmin is implemented in many different ways
Issue Type: cid:jira-generated-image-avatar-532d1b21-285d-4de4-aa88-0951de34aa58 Bug
Affects Versions: 17.1.0
Assignee: Unassigned
Components: Development Issues only
Created: 27/Feb/25 16:50
Priority: cid:jira-generated-image-static-major-81f291bd-5f09-46e6-8c28-3830c992add5 Major
Reporter: Manuel Leduc
Description:

Across our codebase, we have a dozen way to check if a user is superadmin

  • com.xpn.xwiki.internal.plugin.rightsmanager.UserIterator#isSuperAdmi
  • com.xpn.xwiki.user.api.XWikiRightService#isSuperAdmin
  • com.xpn.xwiki.user.impl.xwiki.AbstractXWikiAuthService#isSuperAdmin
  • com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl#isSuperAdmin
  • com.xpn.xwiki.internal.template.InternalTemplateManager.FilesystemTemplateContent#isPrivileged
  • com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl#isSuperAdmin
  • com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl#isSuperAdminOrProgramming
  • org.xwiki.test.checker.internal.ProgrammingRightCheckerAuthorizationManager#check(org.xwiki.model.reference.DocumentReference, com.xpn.xwiki.doc.XWikiDocument)
  • org.xwiki.user.internal.document.AbstractUserReferenceResolver#isSuperAdmin

It would be better to have a single source of truth, especially as some implementations might ne be aligned with each other