Package org.xwiki.security.authorization
Interface ContextualAuthorizationManager
-
@Role public interface ContextualAuthorizationManagerThis API is for checking the access rights of current user in the current context. It replacescom.xpn.xwiki.user.api.XWikiRightService. The ContextualAuthorizationManager does not provide any help for authentication. Authentication should have been ensured previously if needed.- Since:
- 6.1RC1
- Version:
- $Id: d5d1dc21a308f224b8c8ed57735b22a82210a465 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckAccess(Right right)Check if access identified byrighton the current entity is allowed in the current context.voidcheckAccess(Right right, EntityReference entityReference)Check if access identified byrighton the given entity is allowed in the current context.booleanhasAccess(Right right)Verifies if access identified byrighton the current entity would be allowed in the current context.booleanhasAccess(Right right, EntityReference entityReference)Verifies if access identified byrighton the given entity would be allowed in the current context.
-
-
-
Method Detail
-
checkAccess
void checkAccess(Right right) throws AccessDeniedException
Check if access identified byrighton the current entity is allowed in the current context. The context includes information like the authenticated user, the current macro being executed, the rendering context restriction, the dropping of rights by macro, etc... This function should be used at security checkpoint.- Parameters:
right- the right needed for execution of the action- Throws:
AccessDeniedException- if the action should be denied, which may also happen when an error occurs
-
hasAccess
boolean hasAccess(Right right)
Verifies if access identified byrighton the current entity would be allowed in the current context. The context includes information like the authenticated user, the current macro being executed, the rendering context restriction, the dropping of rights by macro, etc... This function should be used for interface matters, usecheckAccess(org.xwiki.security.authorization.Right)at security checkpoints.- Parameters:
right- the right to check .- Returns:
trueif the user has the specified right on the entity,falseotherwise
-
checkAccess
void checkAccess(Right right, EntityReference entityReference) throws AccessDeniedException
Check if access identified byrighton the given entity is allowed in the current context. The context includes information like the authenticated user, the current macro being executed, the rendering context restriction, the dropping of rights by macro, etc... This function should be used at security checkpoint.- Parameters:
right- the right needed for execution of the actionentityReference- the entity on which to check the right- Throws:
AccessDeniedException- if the action should be denied, which may also happen when an error occurs
-
hasAccess
boolean hasAccess(Right right, EntityReference entityReference)
Verifies if access identified byrighton the given entity would be allowed in the current context. The context includes information like the authenticated user, the current macro being executed, the rendering context restriction, the dropping of rights by macro, etc... This function should be used for interface matters, usecheckAccess(org.xwiki.security.authorization.Right)at security checkpoints.- Parameters:
right- the right to check .entityReference- the entity on which to check the right- Returns:
trueif the user has the specified right on the entity,falseotherwise
-
-