public class DefaultAuthorizationService extends AbstractAuthorizationService
NAME_PARAM, QUERY_FIND_BY_NAME| Constructor and Description |
|---|
DefaultAuthorizationService()
Constructs the authorization service.
|
DefaultAuthorizationService(UserAccessor aAccessor,
UserAdministration aUserAdmin,
String aName)
Constructs the service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendRule(AuthorizationRule aRule)
Appends a new authorization rule to the end.
|
<T> T |
check(T aResource,
Operation aOperation)
Checks if the given operation is allowed on the resource.
|
protected List<AuthorizationRule> |
getMappedRules()
For OR mapping.
|
AuthorizationRule[] |
getRules()
Gets the authorization rules.
|
void |
insertRuleAfter(int aIndex,
AuthorizationRule aRule)
Inserts a rule.
|
boolean |
isAllowed(Object aResource,
Operation aOperation)
Checks whether an operation is allowed on a resource.
|
void |
removeRule(int aIndex)
Removes a rule.
|
protected void |
setMappedRules(List<AuthorizationRule> aRules)
For OR mapping.
|
void |
setUserAccessor(UserAccessor aUserAccessor)
Sets the user accessor so that the authorization service can get access
to the logged in user.
|
void |
setUserAdministration(UserAdministration aUserAdmin)
Sets the user administration so that the authorization service can check
information for the the current user.
|
getNamepublic DefaultAuthorizationService(UserAccessor aAccessor, UserAdministration aUserAdmin, String aName)
aAccessor - User accessor.aUserAdmin - User administration.aName - Name of this instance of the service.public DefaultAuthorizationService()
public void setUserAccessor(UserAccessor aUserAccessor)
AuthorizationServiceaUserAccessor - User accessor.public void setUserAdministration(UserAdministration aUserAdmin)
AuthorizationServiceaUserAdmin - User administration.public boolean isAllowed(Object aResource, Operation aOperation)
AuthorizationServiceaResource - Resource.aOperation - Operation.public <T> T check(T aResource,
Operation aOperation)
AuthorizationServiceT - Type of resourceaResource - Resource.aOperation - Operation.public AuthorizationRule[] getRules()
AuthorizationServicepublic void appendRule(AuthorizationRule aRule)
AuthorizationServiceaRule - Rule to append.public void insertRuleAfter(int aIndex,
AuthorizationRule aRule)
AuthorizationServiceaIndex - Index of the position of the rule after insertion.aRule - Rule to insert.public void removeRule(int aIndex)
AuthorizationServiceaIndex - Index of the rule to remove.protected List<AuthorizationRule> getMappedRules()
protected void setMappedRules(List<AuthorizationRule> aRules)
aRules - The rules.Copyright © 2025. All rights reserved.