Package org.jbpm.services.task.identity
Class JAASUserGroupCallbackImpl
- java.lang.Object
-
- org.jbpm.services.task.identity.AbstractUserGroupInfo
-
- org.jbpm.services.task.identity.JAASUserGroupCallbackImpl
-
- All Implemented Interfaces:
org.kie.api.task.UserGroupCallback
public class JAASUserGroupCallbackImpl extends AbstractUserGroupInfo implements org.kie.api.task.UserGroupCallback
JAAS based implementation of user group callback dedicated when using LocalTaskService in container such as JBoss AS. It relies on JACC api to collect information on currently logged on user when querying for tasks.
JACC exposes following named context in PolicyContext:
javax.security.auth.Subject.container
This returnsSubject
instance for currently authenticated user and next principals will be examined to find instances ofGroup
and with given rolePrincipleName (by default Roles).
By default it works with JBoss Application Servers as it uses specific principal name to find the groups.
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DEFAULT_PROPERTIES_NAME
-
Constructor Summary
Constructors Constructor Description JAASUserGroupCallbackImpl(boolean activate)
JAASUserGroupCallbackImpl(String rolesPrincipleName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addExternalUserGroupAdapter(UserGroupAdapter externalUserGroupAdapter)
static void
clearExternalUserGroupAdapter()
boolean
existsGroup(String groupId)
boolean
existsUser(String userId)
List<String>
getGroupsForUser(String userId)
String
getRolePrincipleName()
protected Subject
getSubjectFromContainer()
void
setRolePrincipleName(String rolePrincipleName)
-
Methods inherited from class org.jbpm.services.task.identity.AbstractUserGroupInfo
readProperties
-
-
-
-
Field Detail
-
DEFAULT_PROPERTIES_NAME
protected static final String DEFAULT_PROPERTIES_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JAASUserGroupCallbackImpl
public JAASUserGroupCallbackImpl(boolean activate)
-
JAASUserGroupCallbackImpl
public JAASUserGroupCallbackImpl(String rolesPrincipleName)
-
-
Method Detail
-
addExternalUserGroupAdapter
public static void addExternalUserGroupAdapter(UserGroupAdapter externalUserGroupAdapter)
-
clearExternalUserGroupAdapter
public static void clearExternalUserGroupAdapter()
-
getRolePrincipleName
public String getRolePrincipleName()
-
setRolePrincipleName
public void setRolePrincipleName(String rolePrincipleName)
-
existsUser
public boolean existsUser(String userId)
- Specified by:
existsUser
in interfaceorg.kie.api.task.UserGroupCallback
-
existsGroup
public boolean existsGroup(String groupId)
- Specified by:
existsGroup
in interfaceorg.kie.api.task.UserGroupCallback
-
getGroupsForUser
public List<String> getGroupsForUser(String userId)
- Specified by:
getGroupsForUser
in interfaceorg.kie.api.task.UserGroupCallback
-
getSubjectFromContainer
protected Subject getSubjectFromContainer()
-
-