Details
-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
1.1 M3
-
None
-
plugin package rights
-
Description
In constructor:
public PackageAPI(Package plugin, XWikiContext context) throws PackageException { super(context); if (!hasAdminRights()) throw new PackageException(XWikiException.ERROR_XWIKI_ACCESS_DENIED, "Admin right is needed to use this plugin"); setPlugin(plugin); }
Then in getPackage:
public Package getPackage() { if (hasProgrammingRights()) return plugin; return null; }
If the plugin isn't saved into the local variable unless the user has admin rights, getPackage should also be checking for Admin rights.