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 AbstractDmnBasedPermissionHelper<Conversation>
-
-
Field Summary
Fields Modifier and Type Field Description protected EngageEngineConfiguration
engageEngineConfiguration
protected Collection<String>
userGroupKeys
protected String
userId
protected String
userTenantId
-
Fields 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
Constructors Constructor Description AbstractConversationPermissionCommand(EngageEngineConfiguration engageEngineConfiguration, String userId, Collection<String> userGroupKeys, String userTenantId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Optional<String>
checkBasicConversationAccess(CommandContext commandContext, String userId, Conversation conversation, ParticipantType participantType)
Basic conversation access check if the participant type has already been resolved.protected Map<String,Object>
createRuleInputForDefaultModel(String userId, AuthorizedAction action, Conversation scopedObject, Map<String,Object> detailedRuleInput, CommandContext commandContext)
ParticipantType
evaluateMainParticipantType(ConversationEntity conversation)
Evaluates the participant type of user within the specified conversation.ParticipantType
evaluateMainParticipantType(String userId, Collection<String> userGroupKeys, ConversationEntity conversation)
Evaluates the participant type of the given user within the specified conversation.protected Optional<String>
evaluatePermissionsAndProcessResult(String tenantId, AuthorizedAction action, Conversation scopedObject, Map<String,Object> ruleInput, String decisionModelKey, String globalErrorMessageCode, CommandContext commandContext)
protected String
getDecisionKeyDefaultPermissions()
protected 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 Detail
-
engageEngineConfiguration
protected final EngageEngineConfiguration engageEngineConfiguration
-
userId
protected String userId
-
userGroupKeys
protected Collection<String> userGroupKeys
-
userTenantId
protected String userTenantId
-
-
Constructor Detail
-
AbstractConversationPermissionCommand
public AbstractConversationPermissionCommand(EngageEngineConfiguration engageEngineConfiguration, String userId, Collection<String> userGroupKeys, String userTenantId)
-
-
Method Detail
-
checkBasicConversationAccess
protected Optional<String> checkBasicConversationAccess(CommandContext commandContext, String userId, Conversation conversation, 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
protected String getTenantId(Conversation conversation)
- Specified by:
getTenantId
in classAbstractDmnBasedPermissionHelper<Conversation>
-
evaluateMainParticipantType
public 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 ParticipantType evaluateMainParticipantType(String userId, Collection<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 Optional<String> evaluatePermissionsAndProcessResult(String tenantId, AuthorizedAction action, Conversation scopedObject, Map<String,Object> ruleInput, String decisionModelKey, String globalErrorMessageCode, CommandContext commandContext)
-
createRuleInputForDefaultModel
protected Map<String,Object> createRuleInputForDefaultModel(String userId, AuthorizedAction action, Conversation scopedObject, Map<String,Object> detailedRuleInput, CommandContext commandContext)
- Specified by:
createRuleInputForDefaultModel
in classAbstractDmnBasedPermissionHelper<Conversation>
-
getDecisionKeyDefaultPermissions
protected String getDecisionKeyDefaultPermissions()
- Specified by:
getDecisionKeyDefaultPermissions
in classAbstractDmnBasedPermissionHelper<Conversation>
-
-