|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.seam.security.Identity
org.jboss.seam.security.RuleBasedIdentity
@Name(value="org.jboss.seam.security.identity") @Scope(value=SESSION) @BypassInterceptors @Install(precedence=10, classDependencies="org.drools.WorkingMemory") @Startup public class RuleBasedIdentity
Identity implementation that supports permission checking via a Drools rulebase.
Field Summary | |
---|---|
static String |
RULES_COMPONENT_NAME
|
Fields inherited from class org.jboss.seam.security.Identity |
---|
EVENT_CREDENTIALS_UPDATED, EVENT_LOGGED_OUT, EVENT_LOGIN_FAILED, EVENT_LOGIN_SUCCESSFUL, EVENT_NOT_AUTHORIZED, EVENT_NOT_LOGGED_IN, EVENT_POST_AUTHENTICATE, EVENT_PRE_AUTHENTICATE, EVENT_REMEMBER_ME, ROLES_GROUP, securityEnabled |
Constructor Summary | |
---|---|
RuleBasedIdentity()
|
Method Summary | |
---|---|
boolean |
addRole(String role)
Adds a role to the user's subject, and their security context |
void |
create()
|
org.drools.StatefulSession |
getSecurityContext()
|
org.drools.RuleBase |
getSecurityRules()
|
boolean |
hasPermission(String name,
String action,
Object... arg)
Performs a permission check for the specified name and action |
boolean |
hasRole(String role)
Overridden version of hasRole() that checks for the existence of the role in the security context first. |
protected void |
initSecurityContext()
|
void |
logout()
|
protected void |
postAuthenticate()
|
void |
removeRole(String role)
Removes a role from the user's subject and their security context |
void |
setSecurityContext(org.drools.StatefulSession securityContext)
|
void |
setSecurityRules(org.drools.RuleBase securityRules)
|
protected void |
unAuthenticate()
Removes all Role objects from the security context, removes the "Roles" group from the user's subject. |
Methods inherited from class org.jboss.seam.security.Identity |
---|
authenticate, authenticate, checkEntityPermission, checkPermission, checkRestriction, checkRole, evaluateExpression, getAuthenticateMethod, getDefaultCallbackHandler, getJaasConfigName, getLoginContext, getPassword, getPrincipal, getSubject, getUsername, instance, isCredentialsSet, isLoggedIn, isLoggedIn, isRememberMe, isSecurityEnabled, login, preAuthenticate, quietLogin, setAuthenticateMethod, setJaasConfigName, setPassword, setRememberMe, setSecurityEnabled, setUsername |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String RULES_COMPONENT_NAME
Constructor Detail |
---|
public RuleBasedIdentity()
Method Detail |
---|
public void create()
create
in class Identity
protected void initSecurityContext()
protected void postAuthenticate()
postAuthenticate
in class Identity
public boolean hasPermission(String name, String action, Object... arg)
hasPermission
in class Identity
name
- String The permission nameaction
- String The permission actionarg
- Object Optional object parameter used to make a permission decision
public boolean hasRole(String role)
hasRole
in class Identity
role
- String The name of the role to check
protected void unAuthenticate()
Identity
unAuthenticate
in class Identity
public boolean addRole(String role)
Identity
addRole
in class Identity
role
- The name of the role to addpublic void removeRole(String role)
Identity
removeRole
in class Identity
role
- The name of the role to removepublic org.drools.StatefulSession getSecurityContext()
public void setSecurityContext(org.drools.StatefulSession securityContext)
public org.drools.RuleBase getSecurityRules()
public void setSecurityRules(org.drools.RuleBase securityRules)
public void logout()
logout
in class Identity
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |