org.jboss.seam.security.permission
Class RuleBasedPermissionResolver

java.lang.Object
  extended by org.jboss.seam.security.permission.RuleBasedPermissionResolver
All Implemented Interfaces:
Serializable, PermissionResolver

@Requires(value="org.drools.KnowledgeBase")
@SessionScoped
public class RuleBasedPermissionResolver
extends Object
implements PermissionResolver, Serializable

A permission resolver that uses a Drools rule base to perform permission checks

Author:
Shane Bryzak
See Also:
Serialized Form

Constructor Summary
RuleBasedPermissionResolver()
           
 
Method Summary
 boolean checkConditionalRole(String roleName, Object target, String action)
           
 void filterSetByAction(Set<Object> targets, String action)
           
 org.drools.runtime.StatefulKnowledgeSession getSecurityContext()
           
 org.drools.KnowledgeBase getSecurityRules()
           
 boolean hasPermission(Object resource, String permission)
          Performs a permission check for the specified name and action
 void init()
           
 void setSecurityContext(org.drools.runtime.StatefulKnowledgeSession securityContext)
           
 void setSecurityRules(org.drools.KnowledgeBase securityRules)
           
 void setUserAccountInSecurityContext(PostAuthenticateEvent event)
          Post-authentication event observer
 void unAuthenticate(PostLoggedOutEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleBasedPermissionResolver

public RuleBasedPermissionResolver()
Method Detail

init

@Inject
public void init()

hasPermission

public boolean hasPermission(Object resource,
                             String permission)
Performs a permission check for the specified name and action

Specified by:
hasPermission in interface PermissionResolver
Parameters:
target - Object The target of the permission check
action - String The action to be performed on the target
Returns:
boolean True if the user has the specified permission

filterSetByAction

public void filterSetByAction(Set<Object> targets,
                              String action)
Specified by:
filterSetByAction in interface PermissionResolver

checkConditionalRole

public boolean checkConditionalRole(String roleName,
                                    Object target,
                                    String action)

unAuthenticate

public void unAuthenticate(@Observes
                           PostLoggedOutEvent event)

getSecurityContext

public org.drools.runtime.StatefulKnowledgeSession getSecurityContext()

setSecurityContext

public void setSecurityContext(org.drools.runtime.StatefulKnowledgeSession securityContext)

getSecurityRules

public org.drools.KnowledgeBase getSecurityRules()

setSecurityRules

public void setSecurityRules(org.drools.KnowledgeBase securityRules)

setUserAccountInSecurityContext

public void setUserAccountInSecurityContext(@Observes
                                            PostAuthenticateEvent event)
Post-authentication event observer



Copyright © 2011 Seam Framework. All Rights Reserved.