|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wamblee.security.authorization.jpa.JpaAuthorizationService
public class JpaAuthorizationService
Authorization service with persistent storage. This is a wrapper for
DefaultAuthorizationService
which
refreshes the state of the service at certain time intervals.
Constructor Summary | |
---|---|
JpaAuthorizationService(java.lang.String aName,
javax.persistence.EntityManager aEntityManager,
UserAccessor aAccessor,
UserAdministration aUserAdmin,
long aRefreshInterval)
Constructs the persistent service. |
Method Summary | ||
---|---|---|
void |
appendRule(AuthorizationRule aRule)
Appends a new authorization rule to the end. |
|
|
check(T aResource,
Operation aOperation)
Checks if the given operation is allowed on the resource. |
|
AuthorizationRule[] |
getRules()
Gets the authorization rules. |
|
void |
insertRuleAfter(int aIndex,
AuthorizationRule aRule)
Inserts a rule. |
|
boolean |
isAllowed(java.lang.Object aResource,
Operation aOperation)
Checks whether an operation is allowed on a resource. |
|
void |
removeRule(int aIndex)
Removes a rule. |
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JpaAuthorizationService(java.lang.String aName, javax.persistence.EntityManager aEntityManager, UserAccessor aAccessor, UserAdministration aUserAdmin, long aRefreshInterval)
aName
- Name of the service.aEntityManager
- Entity manager.aAccessor
- User accessor.aUserAdmin
- User administration.aRefresh
- Whether or not to refresh the state of the service at the
start of every operation.Method Detail |
---|
public void setUserAccessor(UserAccessor aUserAccessor)
AuthorizationService
setUserAccessor
in interface AuthorizationService
aUserAccessor
- User accessor.public void setUserAdministration(UserAdministration aUserAdmin)
AuthorizationService
setUserAdministration
in interface AuthorizationService
aUserAdmin
- User administration.public boolean isAllowed(java.lang.Object aResource, Operation aOperation)
AuthorizationService
isAllowed
in interface AuthorizationService
aResource
- Resource.aOperation
- Operation.
public <T> T check(T aResource, Operation aOperation)
AuthorizationService
check
in interface AuthorizationService
T
- Type of resourceaResource
- Resource.aOperation
- Operation.
public AuthorizationRule[] getRules()
AuthorizationService
getRules
in interface AuthorizationService
public void appendRule(AuthorizationRule aRule)
AuthorizationService
appendRule
in interface AuthorizationService
aRule
- Rule to append.public void removeRule(int aIndex)
AuthorizationService
removeRule
in interface AuthorizationService
aIndex
- Index of the rule to remove.public void insertRuleAfter(int aIndex, AuthorizationRule aRule)
AuthorizationService
insertRuleAfter
in interface AuthorizationService
aIndex
- Index of the position of the rule after insertion.aRule
- Rule to insert.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |