Package org.flowable.engine
Interface IdentityService
- All Known Implementing Classes:
IdentityServiceImpl
public interface IdentityService
Service to manage
User
s and Group
s.- Author:
- Tom Baeyens
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkPassword
(String userId, String password) Checks if the password is valid for the given user.org.flowable.idm.api.GroupQuery
Creates aGroupQuery
that allows to programmatically query the groups.void
createMembership
(String userId, String groupId) org.flowable.idm.api.NativeGroupQuery
Returns a newNativeQuery
for tasks.org.flowable.idm.api.NativeUserQuery
Returns a newNativeQuery
for tasks.org.flowable.idm.api.UserQuery
Creates aUserQuery
that allows to programmatically query the users.void
deleteGroup
(String groupId) Deletes the group.void
deleteMembership
(String userId, String groupId) Delete the membership of the user in the group.void
deleteUser
(String userId) void
deleteUserInfo
(String userId, String key) Delete an entry of the generic extensibility key-value pairs associated with a userList<org.flowable.idm.api.Group>
getPotentialStarterGroups
(String processDefinitionId) Returns the potential starter groups for a given process definition.List<org.flowable.idm.api.User>
getPotentialStarterUsers
(String processDefinitionId) Returns the potential starter users for a given process definition.getUserInfo
(String userId, String key) Generic extensibility key-value pairs associated with a usergetUserInfoKeys
(String userId) Generic extensibility keys associated with a userorg.flowable.idm.api.Picture
getUserPicture
(String userId) Retrieves the picture for a given user.org.flowable.idm.api.Group
Creates a new group.org.flowable.idm.api.User
Creates a new user.void
saveGroup
(org.flowable.idm.api.Group group) Saves the group.void
saveUser
(org.flowable.idm.api.User user) Saves the user.void
setAuthenticatedUserId
(String authenticatedUserId) Passes the authenticated user id for this particular thread.void
setUserInfo
(String userId, String key, String value) Generic extensibility key-value pairs associated with a uservoid
setUserPicture
(String userId, org.flowable.idm.api.Picture picture) Sets the picture for a given user.void
updateUserPassword
(org.flowable.idm.api.User user) Update user password.
-
Method Details
-
newUser
Creates a new user. The user is transient and must be saved usingsaveUser(User)
.- Parameters:
userId
- id for the new user, cannot be null.
-
saveUser
void saveUser(org.flowable.idm.api.User user) Saves the user. If the user already existed, the user is updated except user password. UseupdateUserPassword(User)
to update existing user password.- Parameters:
user
- user to save, cannot be null.- Throws:
RuntimeException
- when a user with the same name already exists.- See Also:
-
updateUserPassword
void updateUserPassword(org.flowable.idm.api.User user) Update user password. UsesaveUser(User)
for new user.- Parameters:
user
- user password to change, cannot be null.- See Also:
-
createUserQuery
org.flowable.idm.api.UserQuery createUserQuery()Creates aUserQuery
that allows to programmatically query the users. -
createNativeUserQuery
org.flowable.idm.api.NativeUserQuery createNativeUserQuery()Returns a newNativeQuery
for tasks. -
deleteUser
- Parameters:
userId
- id of user to delete, cannot be null. When an id is passed for a non-existent user, this operation is ignored.
-
newGroup
Creates a new group. The group is transient and must be saved usingsaveGroup(Group)
.- Parameters:
groupId
- id for the new group, cannot be null.
-
createGroupQuery
org.flowable.idm.api.GroupQuery createGroupQuery()Creates aGroupQuery
that allows to programmatically query the groups. -
createNativeGroupQuery
org.flowable.idm.api.NativeGroupQuery createNativeGroupQuery()Returns a newNativeQuery
for tasks. -
getPotentialStarterGroups
Returns the potential starter groups for a given process definition.- Parameters:
processDefinitionId
- process definition identifier- Returns:
- list of potential starter groups
-
getPotentialStarterUsers
Returns the potential starter users for a given process definition.- Parameters:
processDefinitionId
- process definition identifier- Returns:
- list of potential starter users
-
saveGroup
void saveGroup(org.flowable.idm.api.Group group) Saves the group. If the group already existed, the group is updated.- Parameters:
group
- group to save. Cannot be null.- Throws:
RuntimeException
- when a group with the same name already exists.
-
deleteGroup
Deletes the group. When no group exists with the given id, this operation is ignored.- Parameters:
groupId
- id of the group that should be deleted, cannot be null.
-
createMembership
- Parameters:
userId
- the userId, cannot be null.groupId
- the groupId, cannot be null.- Throws:
RuntimeException
- when the given user or group doesn't exist or when the user is already member of the group.
-
deleteMembership
Delete the membership of the user in the group. When the group or user don't exist or when the user is not a member of the group, this operation is ignored.- Parameters:
userId
- the user's id, cannot be null.groupId
- the group's id, cannot be null.
-
checkPassword
Checks if the password is valid for the given user. Arguments userId and password are nullsafe. -
setAuthenticatedUserId
Passes the authenticated user id for this particular thread. All service method (from any service) invocations done by the same thread will have access to this authenticatedUserId. -
setUserPicture
Sets the picture for a given user.- Parameters:
userId
-picture
- can be null to delete the picture.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if the user doesn't exist.
-
getUserPicture
Retrieves the picture for a given user.- Returns:
- null if the user doesn't have a picture.
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if the user doesn't exist.
-
setUserInfo
Generic extensibility key-value pairs associated with a user -
getUserInfo
Generic extensibility key-value pairs associated with a user -
getUserInfoKeys
Generic extensibility keys associated with a user -
deleteUserInfo
Delete an entry of the generic extensibility key-value pairs associated with a user
-