public abstract class AbstractAuthorizationModule extends Object implements AuthorizationModule
Modifier and Type | Field and Description |
---|---|
protected static Map<String,Class<?>> |
clazzMap
A map that is available to reduce the loadClass synchronization
|
protected Map<ResourceType,String> |
delegateMap
Map of delegates for the various layers
|
protected CallbackHandler |
handler |
protected Map<String,Object> |
options |
protected RoleGroup |
role |
protected Map<String,Object> |
sharedState |
protected Subject |
subject |
Constructor and Description |
---|
AbstractAuthorizationModule() |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
Abort the Authorization Process
|
abstract int |
authorize(Resource resource)
Authorize the resource
|
boolean |
commit()
Overall authorization process has succeeded.
|
boolean |
destroy()
A final cleanup opportunity offered
|
protected AuthorizationModuleDelegate |
getDelegate(String delegateStr)
Load the delegate
|
void |
initialize(Subject subject,
CallbackHandler handler,
Map<String,Object> sharedState,
Map<String,Object> options,
RoleGroup subjectRole)
Initialize the module
|
protected int |
invokeDelegate(Resource resource)
Subclasses can use this method to leave the authorization
decision to the delegate configured
|
protected void |
populateDelegateMap(String commaSeparatedDelegates)
Options may have a comma separated delegate map
|
String |
toString()
Override to print more details
|
protected Subject subject
protected CallbackHandler handler
protected RoleGroup role
protected Map<ResourceType,String> delegateMap
public abstract int authorize(Resource resource)
AuthorizationModule
authorize
in interface AuthorizationModule
AuthorizationModule.authorize(Resource)
public boolean abort() throws AuthorizationException
AuthorizationModule
abort
in interface AuthorizationModule
AuthorizationException
AuthorizationModule.abort()
public boolean commit() throws AuthorizationException
AuthorizationModule
commit
in interface AuthorizationModule
AuthorizationException
AuthorizationModule.commit()
public boolean destroy()
AuthorizationModule
destroy
in interface AuthorizationModule
AuthorizationModule.destroy()
public void initialize(Subject subject, CallbackHandler handler, Map<String,Object> sharedState, Map<String,Object> options, RoleGroup subjectRole)
AuthorizationModule
initialize
in interface AuthorizationModule
subject
- the authenticated subjecthandler
- CallbackHandlersharedState
- state shared with other configured modulesoptions
- options specified in the Configuration
for this particular modulesubjectRole
- Roles of the subjectAuthorizationModule.initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map, org.jboss.security.identity.RoleGroup)
public String toString()
protected int invokeDelegate(Resource resource)
protected AuthorizationModuleDelegate getDelegate(String delegateStr) throws Exception
delegateStr
- FQN of the delegateException
protected void populateDelegateMap(String commaSeparatedDelegates)
commaSeparatedDelegates
- Copyright © 2020 JBoss by Red Hat. All rights reserved.