Class AbstractConversationPermissionCommand
java.lang.Object
com.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper<Conversation>
com.flowable.engage.engine.impl.permission.cmd.AbstractConversationPermissionCommand
- Direct Known Subclasses:
CheckArchiveConversationCommand
,CheckCreateConversationCommand
,CheckDropParticipantFromConversationCommand
,CheckEditMessageCommand
,CheckHasAccessToConversationCommand
,CheckJoinParticipantToExistingConversationCommand
,CheckPostDocumentCommand
,CheckPostImageCommand
,CheckPostMessageCommand
,CheckPostVideoCommand
,CheckPostVoiceCommand
,CheckReopenConversationCommand
,CheckUpdateConversationAvatarCommand
,CheckUpdateConversationDescriptionCommand
,CheckUpdateConversationNameCommand
public abstract class AbstractConversationPermissionCommand extends com.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper<Conversation>
-
Field Summary
Fields Modifier and Type Field Description protected EngageEngineConfiguration
engageEngineConfiguration
protected java.util.Collection<java.lang.String>
userGroupKeys
protected java.lang.String
userId
protected java.lang.String
userTenantId
-
Constructor Summary
Constructors Constructor Description AbstractConversationPermissionCommand(EngageEngineConfiguration engageEngineConfiguration, java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId)
-
Method Summary
Modifier and Type Method Description protected java.util.Optional<java.lang.String>
checkBasicConversationAccess(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, java.lang.String userId, Conversation conversation, com.flowable.platform.service.permission.ParticipantType participantType)
Basic conversation access check if the participant type has already been resolved.protected java.util.Map<java.lang.String,java.lang.Object>
createRuleInputForDefaultModel(java.lang.String userId, com.flowable.platform.service.permission.AuthorizedAction action, Conversation scopedObject, java.util.Map<java.lang.String,java.lang.Object> detailedRuleInput, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
com.flowable.platform.service.permission.ParticipantType
evaluateMainParticipantType(ConversationEntity conversation)
Evaluates the participant type of user within the specified conversation.com.flowable.platform.service.permission.ParticipantType
evaluateMainParticipantType(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, ConversationEntity conversation)
Evaluates the participant type of the given user within the specified conversation.protected java.util.Optional<java.lang.String>
evaluatePermissionsAndProcessResult(java.lang.String tenantId, com.flowable.platform.service.permission.AuthorizedAction action, Conversation scopedObject, java.util.Map<java.lang.String,java.lang.Object> ruleInput, java.lang.String decisionModelKey, java.lang.String globalErrorMessageCode, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
protected java.lang.String
getDecisionKeyDefaultPermissions()
protected java.lang.String
getTenantId(Conversation conversation)
Methods inherited from class com.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper
evaluateDefaultPermissionOutput, evaluatePermissionRuleOutput, evaluatePermissionsAndProcessResult, executeAndLogPermissionModel, getEmptyListOnNullValue, getGroups, isGroupMember, isUserMemberOfGroup, isUserType, processErrorMessage, renderErrorMessage
-
Field Details
-
engageEngineConfiguration
-
userId
protected java.lang.String userId -
userGroupKeys
protected java.util.Collection<java.lang.String> userGroupKeys -
userTenantId
protected java.lang.String userTenantId
-
-
Constructor Details
-
AbstractConversationPermissionCommand
public AbstractConversationPermissionCommand(EngageEngineConfiguration engageEngineConfiguration, java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId)
-
-
Method Details
-
checkBasicConversationAccess
protected java.util.Optional<java.lang.String> checkBasicConversationAccess(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, java.lang.String userId, Conversation conversation, com.flowable.platform.service.permission.ParticipantType participantType)Basic conversation access check if the participant type has already been resolved. It returns an optional error message, if the user represented through the participant type is not involved in the conversation.- Returns:
- an optional error message, if the user does not have access to the conversation
-
getTenantId
- Specified by:
getTenantId
in classcom.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper<Conversation>
-
evaluateMainParticipantType
public com.flowable.platform.service.permission.ParticipantType evaluateMainParticipantType(ConversationEntity conversation)Evaluates the participant type of user within the specified conversation. If the same user has different participant types (e.g. is both owner AND assignee), the main one is returned, which is according the following priorities: owner, assignee, assigned group, candidate user, candidate group- Parameters:
conversation
- the conversation for which the participant type is evaluated- Returns:
- the participant type (e.g. owner, assignee, etc)
-
evaluateMainParticipantType
public com.flowable.platform.service.permission.ParticipantType evaluateMainParticipantType(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, ConversationEntity conversation)Evaluates the participant type of the given user within the specified conversation. If the same user has different participant types (e.g. is both owner AND assignee), the main one is returned, which is according the following priorities: owner, assignee, assigned group, candidate user, candidate group- Parameters:
userId
- the id of the user to evaluate its participant typeuserGroupKeys
- the group keys for the user to evaluate its participant typeconversation
- the conversation for which the participant type is evaluated- Returns:
- the participant type (e.g. owner, assignee, etc)
-
evaluatePermissionsAndProcessResult
protected java.util.Optional<java.lang.String> evaluatePermissionsAndProcessResult(java.lang.String tenantId, com.flowable.platform.service.permission.AuthorizedAction action, Conversation scopedObject, java.util.Map<java.lang.String,java.lang.Object> ruleInput, java.lang.String decisionModelKey, java.lang.String globalErrorMessageCode, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) -
createRuleInputForDefaultModel
protected java.util.Map<java.lang.String,java.lang.Object> createRuleInputForDefaultModel(java.lang.String userId, com.flowable.platform.service.permission.AuthorizedAction action, Conversation scopedObject, java.util.Map<java.lang.String,java.lang.Object> detailedRuleInput, org.flowable.common.engine.impl.interceptor.CommandContext commandContext)- Specified by:
createRuleInputForDefaultModel
in classcom.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper<Conversation>
-
getDecisionKeyDefaultPermissions
protected java.lang.String getDecisionKeyDefaultPermissions()- Specified by:
getDecisionKeyDefaultPermissions
in classcom.flowable.platform.service.permission.AbstractDmnBasedPermissionHelper<Conversation>
-