Package org.flowable.idm.api
Interface IdmIdentityService
-
public interface IdmIdentityService- Author:
- Tom Baeyens, Tijs Rademakers, Joram Barrez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddGroupPrivilegeMapping(String privilegeId, String groupId)Assigns a privilege to a group.voidaddUserPrivilegeMapping(String privilegeId, String userId)Assigns a privilege to a user.booleancheckPassword(String userId, String password)Checks if the password is valid for the given user.GroupQuerycreateGroupQuery()Creates aGroupQuerythat allows to programmatically query the groups.voidcreateMembership(String userId, String groupId)NativeGroupQuerycreateNativeGroupQuery()Returns a newNativeQueryfor tasks.NativeTokenQuerycreateNativeTokenQuery()Returns a newNativeQueryfor tokens.NativeUserQuerycreateNativeUserQuery()Returns a newNativeQueryfor tasks.PrivilegecreatePrivilege(String privilegeName)Creates a newPrivilegewith the provided name.PrivilegeQuerycreatePrivilegeQuery()Creates aPrivilegeQuerythat allows to programmatically query privileges.TokenQuerycreateTokenQuery()Creates aTokenQuerythat allows to programmatically query the tokens.UserQuerycreateUserQuery()Creates aUserQuerythat allows to programmatically query the users.voiddeleteGroup(String groupId)Deletes the group.voiddeleteGroupPrivilegeMapping(String privilegeId, String groupId)Delete a privilege for a group.voiddeleteMembership(String userId, String groupId)Delete the membership of the user in the group.voiddeletePrivilege(String privilegeId)Deletes the privilege with the given id.voiddeleteToken(String tokenId)voiddeleteUser(String userId)voiddeleteUserInfo(String userId, String key)Delete an entry of the generic extensibility key-value pairs associated with a uservoiddeleteUserPrivilegeMapping(String privilegeId, String userId)Removes a privilege for a user.List<Group>getGroupsWithPrivilege(String privilegeId)Returns allGroupinstances that have a particular privilege.List<PrivilegeMapping>getPrivilegeMappingsByPrivilegeId(String privilegeId)Get all privilege mappings for a specific privilegeStringgetUserInfo(String userId, String key)Generic extensibility key-value pairs associated with a userList<String>getUserInfoKeys(String userId)Generic extensibility keys associated with a userPicturegetUserPicture(String userId)Retrieves the picture for a given user.List<User>getUsersWithPrivilege(String privilegeId)Returns allUserinstances that have a particular privilege.GroupnewGroup(String groupId)Creates a new group.TokennewToken(String id)Creates a new token.UsernewUser(String userId)Creates a new user.voidsaveGroup(Group group)Saves the group.voidsaveToken(Token token)Saves the token.voidsaveUser(User user)Saves the user.voidsetAuthenticatedUserId(String authenticatedUserId)Passes the authenticated user id for this particular thread.voidsetUserInfo(String userId, String key, String value)Generic extensibility key-value pairs associated with a uservoidsetUserPicture(String userId, Picture picture)Sets the picture for a given user.voidupdateUserPassword(User user)Update user password.
-
-
-
Method Detail
-
newUser
User newUser(String userId)
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(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(User)
-
updateUserPassword
void updateUserPassword(User user)
Update user password. UsesaveUser(User)for new user.- Parameters:
user- user password to change, cannot be null.- See Also:
saveUser(User)
-
createUserQuery
UserQuery createUserQuery()
Creates aUserQuerythat allows to programmatically query the users.
-
createNativeUserQuery
NativeUserQuery createNativeUserQuery()
Returns a newNativeQueryfor tasks.
-
deleteUser
void deleteUser(String userId)
- 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
Group newGroup(String groupId)
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
GroupQuery createGroupQuery()
Creates aGroupQuerythat allows to programmatically query the groups.
-
createNativeGroupQuery
NativeGroupQuery createNativeGroupQuery()
Returns a newNativeQueryfor tasks.
-
saveGroup
void saveGroup(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
void deleteGroup(String groupId)
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
void createMembership(String userId, String groupId)
- 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
void deleteMembership(String userId, String groupId)
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
boolean checkPassword(String userId, String password)
Checks if the password is valid for the given user. Arguments userId and password are nullsafe.
-
setAuthenticatedUserId
void setAuthenticatedUserId(String authenticatedUserId)
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
void setUserPicture(String userId, Picture picture)
Sets the picture for a given user.- Parameters:
userId-picture- can be null to delete the picture.- Throws:
FlowableObjectNotFoundException- if the user doesn't exist.
-
getUserPicture
Picture getUserPicture(String userId)
Retrieves the picture for a given user.- Parameters:
userId-- Returns:
- null if the user doesn't have a picture.
- Throws:
FlowableObjectNotFoundException- if the user doesn't exist.
-
newToken
Token newToken(String id)
Creates a new token. The token is transient and must be saved usingsaveToken(Token).- Parameters:
id- id for the new token, cannot be null.
-
saveToken
void saveToken(Token token)
Saves the token. If the token already existed, the token is updated.- Parameters:
token- token to save, cannot be null.
-
deleteToken
void deleteToken(String tokenId)
- Parameters:
tokenId- id of token to delete, cannot be null. When an id is passed for an non-existent token, this operation is ignored.
-
createTokenQuery
TokenQuery createTokenQuery()
Creates aTokenQuerythat allows to programmatically query the tokens.
-
createNativeTokenQuery
NativeTokenQuery createNativeTokenQuery()
Returns a newNativeQueryfor tokens.
-
setUserInfo
void setUserInfo(String userId, String key, String value)
Generic extensibility key-value pairs associated with a user
-
getUserInfo
String getUserInfo(String userId, String key)
Generic extensibility key-value pairs associated with a user
-
getUserInfoKeys
List<String> getUserInfoKeys(String userId)
Generic extensibility keys associated with a user
-
deleteUserInfo
void deleteUserInfo(String userId, String key)
Delete an entry of the generic extensibility key-value pairs associated with a user
-
createPrivilege
Privilege createPrivilege(String privilegeName)
Creates a newPrivilegewith the provided name.- Throws:
FlowableIllegalArgumentException- if privilegeName is null.
-
addUserPrivilegeMapping
void addUserPrivilegeMapping(String privilegeId, String userId)
Assigns a privilege to a user.
-
deleteUserPrivilegeMapping
void deleteUserPrivilegeMapping(String privilegeId, String userId)
Removes a privilege for a user.
-
addGroupPrivilegeMapping
void addGroupPrivilegeMapping(String privilegeId, String groupId)
Assigns a privilege to a group.
-
deleteGroupPrivilegeMapping
void deleteGroupPrivilegeMapping(String privilegeId, String groupId)
Delete a privilege for a group.
-
getPrivilegeMappingsByPrivilegeId
List<PrivilegeMapping> getPrivilegeMappingsByPrivilegeId(String privilegeId)
Get all privilege mappings for a specific privilege
-
deletePrivilege
void deletePrivilege(String privilegeId)
Deletes the privilege with the given id. Note that this also removes all user/group mappings for this privilege.
-
getUsersWithPrivilege
List<User> getUsersWithPrivilege(String privilegeId)
Returns allUserinstances that have a particular privilege.
-
getGroupsWithPrivilege
List<Group> getGroupsWithPrivilege(String privilegeId)
Returns allGroupinstances that have a particular privilege.
-
createPrivilegeQuery
PrivilegeQuery createPrivilegeQuery()
Creates aPrivilegeQuerythat allows to programmatically query privileges.
-
-