|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.security.authorization.DefaultAuthorizationManager
@Component @Singleton public class DefaultAuthorizationManager
Default implementation of the AuthorizationManager.
| Field Summary |
|---|
| Fields inherited from interface org.xwiki.security.authorization.AuthorizationManager |
|---|
SUPERADMIN_USER |
| Constructor Summary | |
|---|---|
DefaultAuthorizationManager()
|
|
| Method Summary | |
|---|---|
void |
checkAccess(Right right,
DocumentReference userReference,
EntityReference entityReference)
Check if the user identified by userReference has the access identified by right on the
entity identified by entityReference. |
boolean |
hasAccess(Right right,
DocumentReference userReference,
EntityReference entityReference)
Verifies if the user identified by userReference has the access identified by right on the
entity identified by entityReference. |
protected void |
logDeny(DocumentReference user,
EntityReference entity,
Right right,
String info)
Log denied access conclusion. |
Right |
register(RightDescription rightDescription)
Register a new custom Right. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultAuthorizationManager()
| Method Detail |
|---|
public void checkAccess(Right right,
DocumentReference userReference,
EntityReference entityReference)
throws AccessDeniedException
AuthorizationManageruserReference has the access identified by right on the
entity identified by entityReference. Note that some rights may be checked higher in hierarchy of the
provided entity if such right is not enabled at lowest hierarchy level provided.
This function should be used at security checkpoint.
checkAccess in interface AuthorizationManagerright - the right needed for execution of the actionuserReference - the user to check the right forentityReference - the entity on which to check the right
AccessDeniedException - if the action should be denied, which may also happen when an error occurs
public boolean hasAccess(Right right,
DocumentReference userReference,
EntityReference entityReference)
AuthorizationManageruserReference has the access identified by right on the
entity identified by entityReference. Note that some rights may be checked higher in hierarchy of the
provided entity if such right is not enabled at lowest hierarchy level provided.
This function should be used for interface matters, use AuthorizationManager.checkAccess(org.xwiki.security.authorization.Right, org.xwiki.model.reference.DocumentReference, org.xwiki.model.reference.EntityReference) at security checkpoints.
hasAccess in interface AuthorizationManagerright - the right to check .userReference - the user to check the right forentityReference - the entity on which to check the right
true if the user has the specified right on the entity, false otherwise
public Right register(RightDescription rightDescription)
throws UnableToRegisterRightException
AuthorizationManagerRight.
register in interface AuthorizationManagerrightDescription - the full description of the new Right
Right
UnableToRegisterRightException - if an error prevent creation of the new right. Registering exactly
the same right does not cause an exception and return the existing right.
protected void logDeny(DocumentReference user,
EntityReference entity,
Right right,
String info)
user - The user name that was checked.entity - The page that was checked.right - The action that was requested.info - Additional information.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||