org.wamblee.security.authorization
Interface AuthorizationService

All Superinterfaces:
Persistent
All Known Implementing Classes:
DefaultAuthorizationService, PersistentAuthorizationService

public interface AuthorizationService
extends Persistent

Service to determine if access to a certain resource is allowed.

Author:
Erik Brakkee

Method Summary
 void appendRule(AuthorizationRule aRule)
          Appends a new authorization rule to the end.
<T> T
check(T aResource, Operation aOperation)
          Same as 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 interface org.wamblee.persistence.Persistent
getPersistedVersion, getPrimaryKey, setPersistedVersion, setPrimaryKey
 

Method Detail

isAllowed

boolean isAllowed(java.lang.Object aResource,
                  Operation aOperation)
Checks whether an operation is allowed on a resource.

Parameters:
aResource - Resource.
aOperation - Operation.
Returns:
Checks whether the operation is allowed on a resource.

check

<T> T check(T aResource,
            Operation aOperation)
Same as isAllowed(Object, Operation) but throws a RuntimeException in case access is not allowed.

Parameters:
aResource - Resource to check.
aOperation - Operation to perform.
Returns:
Resource that was checked.

getRules

AuthorizationRule[] getRules()
Gets the authorization rules.

Returns:
Rules.

appendRule

void appendRule(AuthorizationRule aRule)
Appends a new authorization rule to the end.

Parameters:
aRule - Rule to append.

removeRule

void removeRule(int aIndex)
Removes a rule.

Parameters:
aRule - Index of the rule to remove.

insertRuleAfter

void insertRuleAfter(int aIndex,
                     AuthorizationRule aRule)
Inserts a rule.

Parameters:
aIndex - Index of the position of the rule after insertion.
aRule - Rule to insert.


Copyright © 2010. All Rights Reserved.