|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.keel.core.container.AbstractKeelServiceable
org.keel.services.authorization.defaultauth.DBAuthorizationManager
This class is an implementation of the AuthorizationManager to authorize services based on database security tables. This class is a keel service based on the AuthorizationManager role. Each service which is Securable obtains this service from the KeelContainer in the setAuthorizationManager() lifecycle method..
| Field Summary | |
private AuthorizationManager |
bypassAm |
private Logger |
log |
private boolean |
rootBypass |
| Fields inherited from class org.keel.core.container.AbstractKeelServiceable |
|
| Fields inherited from interface org.keel.services.authorization.AuthorizationManager |
ROLE |
| Constructor Summary | |
DBAuthorizationManager() |
|
| Method Summary | |
boolean |
allowed(java.lang.Object service, Context c)Same as allowed(Principal), but if the SecurityManager is Contextualizable, it can determine the principal(s) on it's own |
boolean |
allowed(java.lang.Object component, UserEnvironment ue)If we don't specify an operation, determine if the user is allowed to do *anything* with this component. |
boolean |
allowed(Operation o, Context c)If the instance of this SecurityManager is Contextualizable, then we can determine the principal(s) by getting the UserEnvironment from the context. |
boolean |
allowed(Operation o, UserEnvironment ue)Is the specified operation allowed for the given principal? First check all the groups, then check for specific user permission if none of the groups this user belongs to are permitted this operation. |
private boolean |
checkInstanceSecurable(Operation o, UserEnvironment ue) |
private boolean |
checkInstanceSecurableInstance(Operation o, UserEnvironment ue, java.lang.String instanceName)Check permissions for a InstanceSecurable component (e.g. |
private boolean |
checkInvokationSecurable(Operation o, UserEnvironment ue)Check for Invokation-level authorization if all other authorization has been granted. |
private boolean |
checkSecurable(Operation o, UserEnvironment ue)Check permissions for a "regular" Securable component (e.g. |
private boolean |
compare(Persistent rule, java.lang.Object propValue, UserEnvironment ue) |
void |
configure(Configuration configuration)Pass the Configuration to the Configurable class. |
void |
enableLogging(Logger newLog)Provide component with a logger. |
private java.lang.String |
expandValue(java.lang.String value, UserEnvironment ue)Translate a value beginning with "$" to some specific value based on the current user. |
private java.lang.String |
getComponentName(java.lang.Object component)Utility method to get the component name corresponding to a given object |
private PersistentFactory |
getPersistentFactory()Obtains the PersistentFactory to be used when checking authorization |
private PersistentFactory |
getPersistentFactory(Context c)Obtains the PersistentFactory initialized with a specific context |
| Methods inherited from class org.keel.core.container.AbstractKeelServiceable |
getService, getService, getService, getService, getServiceManager, getServiceSelector, releaseService, releaseServices, service |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private Logger log
private boolean rootBypass
private AuthorizationManager bypassAm
| Constructor Detail |
public DBAuthorizationManager()
| Method Detail |
public void enableLogging(Logger newLog)
LogEnabledenableLogging in interface LogEnablednewLog - the logger. Must not be null.
public boolean allowed(Operation o,
UserEnvironment ue)
throws AuthorizationException
allowed in interface AuthorizationManagerAuthorizationException
private boolean checkSecurable(Operation o,
UserEnvironment ue)
throws AuthorizationException
o -ue -AuthorizationException
public boolean allowed(java.lang.Object component,
UserEnvironment ue)
throws AuthorizationException
allowed in interface AuthorizationManagerAuthorizationException
public boolean allowed(java.lang.Object service,
Context c)
throws AuthorizationException
allowed in interface AuthorizationManagerAuthorizationException - If an error occurs trying to determine if the access is granted or not.
private PersistentFactory getPersistentFactory()
throws AuthorizationException
AuthorizationException - if it is not possible to access the factory
private boolean checkInvokationSecurable(Operation o,
UserEnvironment ue)
throws AuthorizationException
o - The Operation requestedue - The UserEnvironment describing the currently logged-in userAuthorizationException - If an error occurs during verification of authorization
private boolean compare(Persistent rule,
java.lang.Object propValue,
UserEnvironment ue)
throws PersistenceException,
AuthorizationException
PersistenceExceptionAuthorizationException
public void configure(Configuration configuration)
throws ConfigurationException
ConfigurableConfiguration to the Configurable class.
configure in interface Configurableconfiguration - the class configurations. Must not be null.ConfigurationException - if an error occursConfigurable.configure(org.apache.avalon.framework.configuration.Configuration)
public boolean allowed(Operation o,
Context c)
throws AuthorizationException
allowed in interface AuthorizationManagero - The Operation object that describes the requested operationc - The Context we use to determine who the user is making the requestAuthorizationException - If an error occurs while trying to determine authorization
private PersistentFactory getPersistentFactory(Context c)
throws AuthorizationException
AuthorizationException
private java.lang.String expandValue(java.lang.String value,
UserEnvironment ue)
throws AuthorizationException
value -AuthorizationExceptionprivate java.lang.String getComponentName(java.lang.Object component)
component -
private boolean checkInstanceSecurable(Operation o,
UserEnvironment ue)
throws AuthorizationException
AuthorizationException
private boolean checkInstanceSecurableInstance(Operation o,
UserEnvironment ue,
java.lang.String instanceName)
throws AuthorizationException
o -ue -AuthorizationException
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||