|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wamblee.persistence.AbstractPersistent
org.wamblee.security.authorization.hibernate.PersistentAuthorizationService
public class PersistentAuthorizationService
Authorization service with persistent storage.
This is a wrapper for DefaultAuthorizationService
which refreshes the state of the service at certain time intervals.
| Constructor Summary | |
|---|---|
PersistentAuthorizationService(java.lang.String aName,
org.springframework.orm.hibernate3.HibernateTemplate aTemplate,
UserAccessor aAccessor,
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)
Same as AuthorizationService.isAllowed(Object, Operation) but throws a
RuntimeException in case access is not allowed. |
|
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. |
|
| Methods inherited from class org.wamblee.persistence.AbstractPersistent |
|---|
getPersistedVersion, getPrimaryKey, setPersistedVersion, setPrimaryKey |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.wamblee.persistence.Persistent |
|---|
getPersistedVersion, getPrimaryKey, setPersistedVersion, setPrimaryKey |
| Constructor Detail |
|---|
public PersistentAuthorizationService(java.lang.String aName,
org.springframework.orm.hibernate3.HibernateTemplate aTemplate,
UserAccessor aAccessor,
long aRefreshInterval)
aName - Name of the service.aTemplate - Hibernate template for hibernate usage.aAccessor - User accessor.aRefresh - Whether or not to refresh the state of the service at the
start of every operation.| Method Detail |
|---|
public boolean isAllowed(java.lang.Object aResource,
Operation aOperation)
AuthorizationService
isAllowed in interface AuthorizationServiceaResource - Resource.aOperation - Operation.
public <T> T check(T aResource,
Operation aOperation)
AuthorizationServiceAuthorizationService.isAllowed(Object, Operation) but throws a
RuntimeException in case access is not allowed.
check in interface AuthorizationServiceaResource - Resource to check.aOperation - Operation to perform.
public AuthorizationRule[] getRules()
AuthorizationService
getRules in interface AuthorizationServicepublic void appendRule(AuthorizationRule aRule)
AuthorizationService
appendRule in interface AuthorizationServiceaRule - Rule to append.public void removeRule(int aIndex)
AuthorizationService
removeRule in interface AuthorizationService
public void insertRuleAfter(int aIndex,
AuthorizationRule aRule)
AuthorizationService
insertRuleAfter in interface AuthorizationServiceaIndex - 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 | |||||||||