Class UserPermissionServiceImpl
java.lang.Object
com.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper<PlatformUser>
com.flowable.platform.service.permission.UserPermissionServiceImpl
- All Implemented Interfaces:
UserPermissionService
public class UserPermissionServiceImpl
extends AbstractDmnBasedPermissionHelper<PlatformUser>
implements UserPermissionService
The default permission service implementing permission checks in the context of a user. Its based on a single permission model used for all actions.
- Author:
- Micha Kiener
-
Field Summary
FieldsFields inherited from class com.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper
NONE_VALUE, OUTPUT_KEY_ERROR_MESSAGE, OUTPUT_KEY_ERROR_MESSAGE_CODE, OUTPUT_KEY_GROUP_NEEDED, OUTPUT_KEY_PERMISSION
-
Constructor Summary
ConstructorsConstructorDescriptionUserPermissionServiceImpl
(CoreIdmEngineConfiguration coreIdmEngineConfiguration) -
Method Summary
Modifier and TypeMethodDescriptioncheckUserCreation
(String userId, String userToCreateId) Deprecated.checkUserCreation
(String userId, Collection<String> userGroupKeys, String userTenantId, String userToCreateId) Evaluates the permissions for the given user when creating a new user.checkUserDeactivation
(String userId, String userToDeactivateId) Deprecated.checkUserDeactivation
(String userId, Collection<String> userGroupKeys, String userTenantId, String userToDeactivateId) Evaluates the permissions for the given user when deactivating a user.checkUserReactivation
(String userId, String userToReactivateId) Deprecated.checkUserReactivation
(String userId, Collection<String> userGroupKeys, String userTenantId, String userToReactivateId) createRuleInputForDefaultModel
(String userId, AuthorizedAction action, PlatformUser scopedObject, Map<String, Object> detailedRuleInput, CommandContext commandContext) IfAbstractDmnBasedPermissionHelper.getDecisionKeyDefaultPermissions()
returns a non-null value, this method must be implemented in order to create the rule input data for evaluating the default permission model.protected String
If the permission helper is based on a default and detail DMN permission rule mechanism, this method must return the DMN key of the default permission rule model to execute.protected String
getTenantId
(PlatformUser user) void
setDecisionKeyDefaultPermissions
(String decisionKeyDefaultPermissions) Methods inherited from class com.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper
evaluateDefaultPermissionOutput, evaluatePermissionRuleOutput, evaluatePermissionsAndProcessResult, executeAndLogPermissionModel, getEmptyListOnNullValue, getGroups, isGroupMember, isUserMemberOfGroup, isUserType, processErrorMessage, renderErrorMessage
-
Field Details
-
decisionKeyDefaultPermissions
-
coreIdmEngineConfiguration
-
-
Constructor Details
-
UserPermissionServiceImpl
-
-
Method Details
-
checkUserCreation
Deprecated.Description copied from interface:UserPermissionService
Evaluates the permissions for the given user when creating a new user.- Specified by:
checkUserCreation
in interfaceUserPermissionService
- Parameters:
userId
- the id of the user to check the permissions for (not the one being deactivated)userToCreateId
- the id of the new user to be created- Returns:
- the permission error message, if permission is denied to create the user or no message, if permission is granted
-
checkUserCreation
public Optional<String> checkUserCreation(String userId, Collection<String> userGroupKeys, String userTenantId, String userToCreateId) Description copied from interface:UserPermissionService
Evaluates the permissions for the given user when creating a new user.- Specified by:
checkUserCreation
in interfaceUserPermissionService
- Parameters:
userId
- the id of the user to check the permissions for (not the one being deactivated)userGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsuserToCreateId
- the id of the new user to be created- Returns:
- the permission error message, if permission is denied to create the user or no message, if permission is granted
-
checkUserDeactivation
Deprecated.Description copied from interface:UserPermissionService
Evaluates the permissions for the given user when deactivating a user.- Specified by:
checkUserDeactivation
in interfaceUserPermissionService
- Parameters:
userId
- the id of the user to check the permissions for (not the one being deactivated)userToDeactivateId
- the id of the user to be deactivated- Returns:
- the permission error message, if permission is denied to deactivate the user or no message, if permission is granted
-
checkUserDeactivation
public Optional<String> checkUserDeactivation(String userId, Collection<String> userGroupKeys, String userTenantId, String userToDeactivateId) Description copied from interface:UserPermissionService
Evaluates the permissions for the given user when deactivating a user.- Specified by:
checkUserDeactivation
in interfaceUserPermissionService
- Parameters:
userId
- the id of the user to check the permissions for (not the one being deactivated)userGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsuserToDeactivateId
- the id of the user to be deactivated- Returns:
- the permission error message, if permission is denied to deactivate the user or no message, if permission is granted
-
checkUserReactivation
Deprecated.Description copied from interface:UserPermissionService
Evaluates the permissions for the given user when reactivating a user.- Specified by:
checkUserReactivation
in interfaceUserPermissionService
- Parameters:
userId
- the id of the user to check the permissions for (not the one being reactivated)userToReactivateId
- the id of the user to be reactivated- Returns:
- the permission error message, if permission is denied to reactivate the user or no message, if permission is granted
-
checkUserReactivation
public Optional<String> checkUserReactivation(String userId, Collection<String> userGroupKeys, String userTenantId, String userToReactivateId) - Specified by:
checkUserReactivation
in interfaceUserPermissionService
-
createRuleInputForDefaultModel
protected Map<String,Object> createRuleInputForDefaultModel(String userId, AuthorizedAction action, PlatformUser scopedObject, Map<String, Object> detailedRuleInput, CommandContext commandContext) Description copied from class:AbstractDmnBasedPermissionHelper
IfAbstractDmnBasedPermissionHelper.getDecisionKeyDefaultPermissions()
returns a non-null value, this method must be implemented in order to create the rule input data for evaluating the default permission model. The easiest way is by just returning the same rule input as being used for the detailed rule model, but in some cases, the rule input data is different for the default DMN model.- Specified by:
createRuleInputForDefaultModel
in classAbstractDmnBasedPermissionHelper<PlatformUser>
- Parameters:
userId
- the id of the user to test for action permissionsaction
- the action to test privilegesscopedObject
- the optional scoped object for which the action should be checkeddetailedRuleInput
- the rule input as provided and used for the detailed rule model executioncommandContext
- the command context used for execution or access to further services- Returns:
- the rule input data used for executing the default DMN permission model
-
getTenantId
- Specified by:
getTenantId
in classAbstractDmnBasedPermissionHelper<PlatformUser>
-
getDecisionKeyDefaultPermissions
Description copied from class:AbstractDmnBasedPermissionHelper
If the permission helper is based on a default and detail DMN permission rule mechanism, this method must return the DMN key of the default permission rule model to execute.- Specified by:
getDecisionKeyDefaultPermissions
in classAbstractDmnBasedPermissionHelper<PlatformUser>
- Returns:
- the optional key of the default DMN permission model,
null
, if none needed
-
setDecisionKeyDefaultPermissions
-