public interface XWikiRightService
Modifier and Type | Field and Description |
---|---|
static String |
ALLGROUP_GROUP
The AllGroup username.
|
static String |
ALLGROUP_GROUP_FULLNAME
The AllGroup full name.
|
static String |
GUEST_USER
The Guest username.
|
static String |
GUEST_USER_FULLNAME
The Guest full name.
|
static String |
SUPERADMIN_USER
The Superadmin username.
|
static String |
SUPERADMIN_USER_FULLNAME
The Superadmin full name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkAccess(String action,
XWikiDocument doc,
XWikiContext context)
Checks if the wiki current user has the right to execute (@code action} on the document
doc , along with
redirecting to the login if it's not the case and there is no logged in user (the user is the guest user). |
boolean |
hasAccessLevel(String right,
String username,
String docname,
XWikiContext context)
|
boolean |
hasAdminRights(XWikiContext context)
Deprecated.
since 6.1RC1, use
ContextualAuthorizationManager.hasAccess(org.xwiki.security.authorization.Right)
instead |
boolean |
hasProgrammingRights(XWikiContext context)
Deprecated.
since 6.1RC1, use
ContextualAuthorizationManager.hasAccess(org.xwiki.security.authorization.Right)
instead |
boolean |
hasProgrammingRights(XWikiDocument doc,
XWikiContext context)
Deprecated.
|
boolean |
hasWikiAdminRights(XWikiContext context)
Deprecated.
|
static boolean |
isGuest(EntityReference userReference) |
static boolean |
isSuperAdmin(EntityReference userReference) |
List<String> |
listAllLevels(XWikiContext context) |
static final String SUPERADMIN_USER
static final String SUPERADMIN_USER_FULLNAME
static final String GUEST_USER
static final String GUEST_USER_FULLNAME
static final String ALLGROUP_GROUP
static final String ALLGROUP_GROUP_FULLNAME
static boolean isSuperAdmin(EntityReference userReference)
userReference
- the user referencestatic boolean isGuest(EntityReference userReference)
userReference
- the user referenceboolean checkAccess(String action, XWikiDocument doc, XWikiContext context) throws XWikiException
doc
, along with
redirecting to the login if it's not the case and there is no logged in user (the user is the guest user).action
- the action to be executed on the documentdoc
- the document to perform action oncontext
- the xwiki context in which to perform the verification (from which to get the user, for example)true
if the user has right to execute action
on doc
, false
otherwise
and requests the login from the authentication service (redirecting to the login page in the
case of a form authenticator, for example) when no user is logged in. XWikiException
- if something goes wrong during the rights checking process@Deprecated boolean hasAccessLevel(String right, String username, String docname, XWikiContext context) throws XWikiException
AuthorizationManager.hasAccess(org.xwiki.security.authorization.Right, org.xwiki.model.reference.DocumentReference, org.xwiki.model.reference.EntityReference)
insteadusername
has the access level identified by right
on the
document with the name docname
.right
- the access level to check (for example, 'view' or 'edit' or 'comment').username
- the name of the user to check the right fordocname
- the document on which to check the rightcontext
- the xwiki context in which to perform the verificationtrue
if the user has the specified right on the document, false
otherwiseXWikiException
- if something goes wrong during the rights checking process@Deprecated boolean hasProgrammingRights(XWikiContext context)
ContextualAuthorizationManager.hasAccess(org.xwiki.security.authorization.Right)
insteadcontext
- the xwiki context of this requesttrue
if the author of the context document has programming rights, false
otherwise.@Deprecated boolean hasProgrammingRights(XWikiDocument doc, XWikiContext context)
ContextualAuthorizationManager.hasAccess(org.xwiki.security.authorization.Right, org.xwiki.model.reference.EntityReference)
insteaddoc
- the document to check programming rights forcontext
- the xwiki context of this requesttrue
if the author of doc
has programming rights, false
otherwise.@Deprecated boolean hasAdminRights(XWikiContext context)
ContextualAuthorizationManager.hasAccess(org.xwiki.security.authorization.Right)
insteadcontext
- the xwiki context of this requesttrue
if the current user in the context has the admin
right, false
otherwise@Deprecated boolean hasWikiAdminRights(XWikiContext context)
ContextualAuthorizationManager.hasAccess(org.xwiki.security.authorization.Right, org.xwiki.model.reference.EntityReference)
insteadcontext
- the xwiki context of this requesttrue
if the current user in the context has the admin
right, false
otherwiseList<String> listAllLevels(XWikiContext context) throws XWikiException
context
- the xwiki context of this requestXWikiException
- if something goes wrong during the rights checking processCopyright © 2004–2021 XWiki. All rights reserved.