Class DbIdentityServiceProvider
- java.lang.Object
-
- org.camunda.bpm.engine.impl.persistence.AbstractManager
-
- org.camunda.bpm.engine.impl.identity.db.DbReadOnlyIdentityServiceProvider
-
- org.camunda.bpm.engine.impl.identity.db.DbIdentityServiceProvider
-
- All Implemented Interfaces:
ReadOnlyIdentityProvider,WritableIdentityProvider,Session
public class DbIdentityServiceProvider extends DbReadOnlyIdentityServiceProvider implements WritableIdentityProvider
WritableIdentityProviderimplementation backed by a database. This implementation is used for the built-in user management.- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected static IndentityLoggerLOG
-
Constructor Summary
Constructors Constructor Description DbIdentityServiceProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckPassword(java.lang.String userId, java.lang.String password)protected voidcreateDefaultAuthorizations(Group group)protected voidcreateDefaultAuthorizations(Tenant tenant)protected voidcreateDefaultAuthorizations(UserEntity userEntity)protected voidcreateDefaultMembershipAuthorizations(java.lang.String userId, java.lang.String groupId)protected voidcreateDefaultTenantMembershipAuthorizations(Tenant tenant, Group group)protected voidcreateDefaultTenantMembershipAuthorizations(Tenant tenant, User user)IdentityOperationResultcreateMembership(java.lang.String userId, java.lang.String groupId)Creates a membership relation between a user and a group.GroupEntitycreateNewGroup(java.lang.String groupId)Returns a new (transient)Groupobject.TenantcreateNewTenant(java.lang.String tenantId)Returns a new (transient)Tenantobject.UserEntitycreateNewUser(java.lang.String userId)Returns a new (transient)Userobject.IdentityOperationResultcreateTenantGroupMembership(java.lang.String tenantId, java.lang.String groupId)Creates a membership relation between a tenant and a group.IdentityOperationResultcreateTenantUserMembership(java.lang.String tenantId, java.lang.String userId)Creates a membership relation between a tenant and a user.IdentityOperationResultdeleteGroup(java.lang.String groupId)Allows deleting a persistentGroupobject.IdentityOperationResultdeleteMembership(java.lang.String userId, java.lang.String groupId)Deletes a membership relation between a user and a group.protected voiddeleteMembershipsByGroupId(java.lang.String groupId)protected voiddeleteMembershipsByUserId(java.lang.String userId)IdentityOperationResultdeleteTenant(java.lang.String tenantId)Allows deleting a persistentTenantobject.IdentityOperationResultdeleteTenantGroupMembership(java.lang.String tenantId, java.lang.String groupId)Deletes a membership relation between a tenant and a group.protected voiddeleteTenantMembershipsOfGroup(java.lang.String groupId)protected voiddeleteTenantMembershipsOfTenant(java.lang.String tenant)protected voiddeleteTenantMembershipsOfUser(java.lang.String userId)IdentityOperationResultdeleteTenantUserMembership(java.lang.String tenantId, java.lang.String userId)Deletes a membership relation between a tenant and a user.IdentityOperationResultdeleteUser(java.lang.String userId)Allows deleting a persistentUserobject.protected booleanisUserLocked(UserEntity user)protected voidlockUser(UserEntity user)IdentityOperationResultsaveGroup(Group group)Allows saving aGroupobject which is not yet persistent.IdentityOperationResultsaveTenant(Tenant tenant)Allows saving aTenantobject which is not yet persistent.IdentityOperationResultsaveUser(User user)Allows saving or updates aUserobjectIdentityOperationResultunlockUser(java.lang.String userId)Allows unlocking aUserobject.protected IdentityOperationResultunlockUser(UserEntity user)-
Methods inherited from class org.camunda.bpm.engine.impl.identity.db.DbReadOnlyIdentityServiceProvider
checkAuthorization, configureQuery, createGroupQuery, createGroupQuery, createNativeUserQuery, createTenantQuery, createTenantQuery, createUserQuery, createUserQuery, existsMembership, existsTenantMembership, findGroupById, findGroupByQueryCriteria, findGroupCountByQueryCriteria, findTenantById, findTenantByQueryCriteria, findTenantCountByQueryCriteria, findUserById, findUserByNativeQuery, findUserByQueryCriteria, findUserCountByNativeQuery, findUserCountByQueryCriteria, matchPassword
-
Methods inherited from class org.camunda.bpm.engine.impl.persistence.AbstractManager
close, delete, deleteAuthorizations, deleteAuthorizationsForGroup, deleteAuthorizationsForUser, deleteDefaultAuthorizations, flush, getAttachmentManager, getAuthorizationManager, getBatchManager, getByteArrayManager, getCamundaFormDefinitionManager, getCaseDefinitionManager, getCaseExecutionManager, getCaseInstanceManager, getCommandContext, getCurrentAuthentication, getDbEntityManager, getDbSqlSession, getDecisionDefinitionManager, getDecisionRequirementsDefinitionManager, getDeploymentManager, getEventSubscriptionManager, getHistoricActivityInstanceManager, getHistoricBatchManager, getHistoricCaseActivityInstanceManager, getHistoricCaseInstanceManager, getHistoricDecisionInstanceManager, getHistoricDetailManager, getHistoricExternalTaskLogManager, getHistoricIdentityLinkManager, getHistoricIncidentManager, getHistoricJobLogManager, getHistoricProcessInstanceManager, getHistoricReportManager, getHistoricTaskInstanceManager, getHistoricVariableInstanceManager, getIdentityInfoManager, getIdentityLinkManager, getJobDefinitionManager, getJobManager, getProcessDefinitionManager, getProcessInstanceManager, getResourceAuthorizationProvider, getResourceManager, getSession, getTaskManager, getTaskReportManager, getTenantManager, getUserOperationLogManager, getVariableInstanceManager, insert, isAuthorizationEnabled, saveDefaultAuthorizations
-
-
-
-
Field Detail
-
LOG
protected static final IndentityLogger LOG
-
-
Method Detail
-
createNewUser
public UserEntity createNewUser(java.lang.String userId)
Description copied from interface:WritableIdentityProviderReturns a new (transient)
Userobject. The Object is not yet persistent and must be saved using theWritableIdentityProvider.saveUser(User)method.NOTE: the implementation does not validate the uniqueness of the userId parameter at this time.
- Specified by:
createNewUserin interfaceWritableIdentityProvider- Returns:
- an non-persistent user object.
-
saveUser
public IdentityOperationResult saveUser(User user)
Description copied from interface:WritableIdentityProviderAllows saving or updates aUserobject- Specified by:
saveUserin interfaceWritableIdentityProvider- Parameters:
user- a User object.- Returns:
- the operation result object.
-
deleteUser
public IdentityOperationResult deleteUser(java.lang.String userId)
Description copied from interface:WritableIdentityProviderAllows deleting a persistentUserobject.- Specified by:
deleteUserin interfaceWritableIdentityProvider- Returns:
- the operation result object.
-
checkPassword
public boolean checkPassword(java.lang.String userId, java.lang.String password)- Specified by:
checkPasswordin interfaceReadOnlyIdentityProvider- Overrides:
checkPasswordin classDbReadOnlyIdentityServiceProvider- Returns:
- 'true' if the password matches the
-
isUserLocked
protected boolean isUserLocked(UserEntity user)
-
lockUser
protected void lockUser(UserEntity user)
-
unlockUser
public IdentityOperationResult unlockUser(java.lang.String userId)
Description copied from interface:WritableIdentityProviderAllows unlocking aUserobject.- Specified by:
unlockUserin interfaceWritableIdentityProvider- Parameters:
userId- the id of the User object to delete.- Returns:
- the operation result object.
-
unlockUser
protected IdentityOperationResult unlockUser(UserEntity user)
-
createNewGroup
public GroupEntity createNewGroup(java.lang.String groupId)
Description copied from interface:WritableIdentityProviderReturns a new (transient)
Groupobject. The Object is not yet persistent and must be saved using theWritableIdentityProvider.saveGroup(Group)method.NOTE: the implementation does not validate the uniqueness of the groupId parameter at this time.
- Specified by:
createNewGroupin interfaceWritableIdentityProvider- Returns:
- an non-persistent group object.
-
saveGroup
public IdentityOperationResult saveGroup(Group group)
Description copied from interface:WritableIdentityProviderAllows saving aGroupobject which is not yet persistent.- Specified by:
saveGroupin interfaceWritableIdentityProvider- Parameters:
group- a group object.- Returns:
- the operation result object.
-
deleteGroup
public IdentityOperationResult deleteGroup(java.lang.String groupId)
Description copied from interface:WritableIdentityProviderAllows deleting a persistentGroupobject.- Specified by:
deleteGroupin interfaceWritableIdentityProvider- Parameters:
groupId- the id of the group object to delete.- Returns:
- the operation result object.
-
createNewTenant
public Tenant createNewTenant(java.lang.String tenantId)
Description copied from interface:WritableIdentityProviderReturns a new (transient)
Tenantobject. The Object is not yet persistent and must be saved using theWritableIdentityProvider.saveTenant(Tenant)method.NOTE: the implementation does not validate the uniqueness of the tenantId parameter at this time.
- Specified by:
createNewTenantin interfaceWritableIdentityProvider- Parameters:
tenantId- the id of the new tenant- Returns:
- an non-persistent tenant object.
-
saveTenant
public IdentityOperationResult saveTenant(Tenant tenant)
Description copied from interface:WritableIdentityProviderAllows saving aTenantobject which is not yet persistent.- Specified by:
saveTenantin interfaceWritableIdentityProvider- Parameters:
tenant- the tenant object to save.- Returns:
- the operation result object.
-
deleteTenant
public IdentityOperationResult deleteTenant(java.lang.String tenantId)
Description copied from interface:WritableIdentityProviderAllows deleting a persistentTenantobject.- Specified by:
deleteTenantin interfaceWritableIdentityProvider- Parameters:
tenantId- the id of the tenant object to delete.- Returns:
- the operation result object.
-
createMembership
public IdentityOperationResult createMembership(java.lang.String userId, java.lang.String groupId)
Description copied from interface:WritableIdentityProviderCreates a membership relation between a user and a group. If the user is already part of that group, IdentityProviderException is thrown.- Specified by:
createMembershipin interfaceWritableIdentityProvider- Parameters:
userId- the id of the usergroupId- id of the group- Returns:
- the operation result object.
-
deleteMembership
public IdentityOperationResult deleteMembership(java.lang.String userId, java.lang.String groupId)
Description copied from interface:WritableIdentityProviderDeletes a membership relation between a user and a group.- Specified by:
deleteMembershipin interfaceWritableIdentityProvider- Parameters:
userId- the id of the usergroupId- id of the group- Returns:
- the operation result object.
-
deleteMembershipsByUserId
protected void deleteMembershipsByUserId(java.lang.String userId)
-
deleteMembershipsByGroupId
protected void deleteMembershipsByGroupId(java.lang.String groupId)
-
createTenantUserMembership
public IdentityOperationResult createTenantUserMembership(java.lang.String tenantId, java.lang.String userId)
Description copied from interface:WritableIdentityProviderCreates a membership relation between a tenant and a user.- Specified by:
createTenantUserMembershipin interfaceWritableIdentityProvider- Parameters:
tenantId- the id of the tenantuserId- the id of the user- Returns:
- the operation result object.
-
createTenantGroupMembership
public IdentityOperationResult createTenantGroupMembership(java.lang.String tenantId, java.lang.String groupId)
Description copied from interface:WritableIdentityProviderCreates a membership relation between a tenant and a group.- Specified by:
createTenantGroupMembershipin interfaceWritableIdentityProvider- Parameters:
tenantId- the id of the tenantgroupId- the id of the group- Returns:
- the operation result object.
-
deleteTenantUserMembership
public IdentityOperationResult deleteTenantUserMembership(java.lang.String tenantId, java.lang.String userId)
Description copied from interface:WritableIdentityProviderDeletes a membership relation between a tenant and a user.- Specified by:
deleteTenantUserMembershipin interfaceWritableIdentityProvider- Parameters:
tenantId- the id of the tenantuserId- the id of the user- Returns:
- the operation result object
-
deleteTenantGroupMembership
public IdentityOperationResult deleteTenantGroupMembership(java.lang.String tenantId, java.lang.String groupId)
Description copied from interface:WritableIdentityProviderDeletes a membership relation between a tenant and a group.- Specified by:
deleteTenantGroupMembershipin interfaceWritableIdentityProvider- Parameters:
tenantId- the id of the tenantgroupId- the id of the group- Returns:
- the operation result object.
-
deleteTenantMembershipsOfUser
protected void deleteTenantMembershipsOfUser(java.lang.String userId)
-
deleteTenantMembershipsOfGroup
protected void deleteTenantMembershipsOfGroup(java.lang.String groupId)
-
deleteTenantMembershipsOfTenant
protected void deleteTenantMembershipsOfTenant(java.lang.String tenant)
-
createDefaultAuthorizations
protected void createDefaultAuthorizations(UserEntity userEntity)
-
createDefaultAuthorizations
protected void createDefaultAuthorizations(Group group)
-
createDefaultAuthorizations
protected void createDefaultAuthorizations(Tenant tenant)
-
createDefaultMembershipAuthorizations
protected void createDefaultMembershipAuthorizations(java.lang.String userId, java.lang.String groupId)
-
createDefaultTenantMembershipAuthorizations
protected void createDefaultTenantMembershipAuthorizations(Tenant tenant, User user)
-
-