Interface ConversationPermissionService
- All Known Implementing Classes:
ConversationPermissionServiceImpl
public interface ConversationPermissionService
The permission helper must be used to check permissions on actions to be executed in the context of a conversation
like adding or removing participants or posting a voice message, etc.
- Author:
- Micha Kiener, Filip Hrisafov
-
Method Summary
Modifier and Type Method Description java.util.Optional<java.lang.String>
checkArchiveConversation(java.lang.String userId, java.lang.String conversationId)
Deprecated.java.util.Optional<java.lang.String>
checkArchiveConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)
Evaluates the permissions for the given user when archiving an existing conversation.java.util.Optional<java.lang.String>
checkCreateConversation(java.lang.String userId, java.lang.String parentConversationId, ConversationBuilder conversationBuilder)
Deprecated.java.util.Optional<java.lang.String>
checkCreateConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String parentConversationId, ConversationBuilder conversationBuilder)
Evaluates the permissions for the given user when creating a new conversation with an optional parent conversation (e.g.java.util.Optional<java.lang.String>
checkDropParticipantFromConversation(java.lang.String userId, java.lang.String conversationId, java.lang.String droppedParticipantUserId)
Deprecated.java.util.Optional<java.lang.String>
checkDropParticipantFromConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String droppedParticipantUserId)
Evaluates the permissions for the given user when dropping a participant from a conversation.java.util.Optional<java.lang.String>
checkEditMessage(java.lang.String userId, java.lang.String conversationId, java.lang.String messageId)
Deprecated.java.util.Optional<java.lang.String>
checkEditMessage(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String messageId)
Evaluates the permissions for the given user when editing an existing message of a conversation.java.util.Optional<java.lang.String>
checkJoinParticipantToExistingConversation(java.lang.String userId, java.lang.String conversationId, java.lang.String newParticipantUserId)
Deprecated.java.util.Optional<java.lang.String>
checkJoinParticipantToExistingConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String newParticipantUserId)
Evaluates the permissions for the given user when inviting a new participant to an existing conversation.default java.util.Optional<java.lang.String>
checkPostAction(java.lang.String userId, java.lang.String conversationId, java.lang.String actionInstanceId, java.lang.String actionDefinitionId, java.lang.String actionDefinitionKey)
Deprecated.default java.util.Optional<java.lang.String>
checkPostAction(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String actionInstanceId, java.lang.String actionDefinitionId, java.lang.String actionDefinitionKey)
Evaluates the permissions for the given user when posting an action message to a conversation.java.util.Optional<java.lang.String>
checkPostMedia(java.lang.String userId, java.lang.String conversationId, java.lang.String mimeType)
Deprecated.java.util.Optional<java.lang.String>
checkPostMedia(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String mimeType)
Evaluates the permissions for the given user when posing a media to a conversation.java.util.Optional<java.lang.String>
checkPostMessage(java.lang.String userId, java.lang.String conversationId)
Deprecated.java.util.Optional<java.lang.String>
checkPostMessage(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)
Evaluates the permissions for the given user when posting a message to a conversation.java.util.Optional<java.lang.String>
checkReopenConversation(java.lang.String userId, java.lang.String conversationId)
Deprecated.java.util.Optional<java.lang.String>
checkReopenConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)
Evaluates the permissions for the given user when re-opening an archived conversation.java.util.Optional<java.lang.String>
checkUpdateConversationAvatar(java.lang.String userId, java.lang.String conversationId)
Deprecated.java.util.Optional<java.lang.String>
checkUpdateConversationAvatar(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)
Evaluates the permissions for the given user when posing a media to a conversation.java.util.Optional<java.lang.String>
checkUpdateConversationDescription(java.lang.String userId, java.lang.String conversationId)
Deprecated.java.util.Optional<java.lang.String>
checkUpdateConversationDescription(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)
Evaluates the permissions for the given user when updating the conversation description.java.util.Optional<java.lang.String>
checkUpdateConversationName(java.lang.String userId, java.lang.String conversationId)
Deprecated.java.util.Optional<java.lang.String>
checkUpdateConversationName(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)
Evaluates the permissions for the given user when updating the conversation name.default boolean
hasAccessToConversation(java.lang.String userId, java.lang.String conversationId)
Deprecated.boolean
hasAccessToConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)
-
Method Details
-
checkCreateConversation
@Deprecated java.util.Optional<java.lang.String> checkCreateConversation(java.lang.String userId, java.lang.String parentConversationId, ConversationBuilder conversationBuilder)Deprecated.Evaluates the permissions for the given user when creating a new conversation with an optional parent conversation (e.g. if creating a sub-conversation like a topic or ticket).- Parameters:
userId
- the id of the user to check the permissionsparentConversationId
- the optional parent conversation, if the new one is a child (sub-conversation), might benull
conversationBuilder
- the builder having all the details of the new conversation to be started, needs at least type and subtype to be set- Returns:
- the permission error message, if permission is denied to start the new conversation or no message, if permission is granted
-
checkCreateConversation
java.util.Optional<java.lang.String> checkCreateConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String parentConversationId, ConversationBuilder conversationBuilder)Evaluates the permissions for the given user when creating a new conversation with an optional parent conversation (e.g. if creating a sub-conversation like a topic or ticket).- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsparentConversationId
- the optional parent conversation, if the new one is a child (sub-conversation), might benull
conversationBuilder
- the builder having all the details of the new conversation to be started, needs at least type and subtype to be set- Returns:
- the permission error message, if permission is denied to start the new conversation or no message, if permission is granted
-
checkUpdateConversationName
@Deprecated java.util.Optional<java.lang.String> checkUpdateConversationName(java.lang.String userId, java.lang.String conversationId)Deprecated.Evaluates the permissions for the given user when updating the conversation name.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation where the name is being changed- Returns:
- the permission error message, if permission is denied to change the conversation name or no message, if permission is granted
-
checkUpdateConversationName
java.util.Optional<java.lang.String> checkUpdateConversationName(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)Evaluates the permissions for the given user when updating the conversation name.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation where the name is being changed- Returns:
- the permission error message, if permission is denied to change the conversation name or no message, if permission is granted
-
checkUpdateConversationDescription
@Deprecated java.util.Optional<java.lang.String> checkUpdateConversationDescription(java.lang.String userId, java.lang.String conversationId)Deprecated.Evaluates the permissions for the given user when updating the conversation description.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation where the description is being changed- Returns:
- the permission error message, if permission is denied to change the conversation description or no message, if permission is granted
-
checkUpdateConversationDescription
java.util.Optional<java.lang.String> checkUpdateConversationDescription(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)Evaluates the permissions for the given user when updating the conversation description.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation where the description is being changed- Returns:
- the permission error message, if permission is denied to change the conversation description or no message, if permission is granted
-
checkArchiveConversation
@Deprecated java.util.Optional<java.lang.String> checkArchiveConversation(java.lang.String userId, java.lang.String conversationId)Deprecated.Evaluates the permissions for the given user when archiving an existing conversation.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation to be archived- Returns:
- the permission error message, if permission is denied to archive the conversation or no message, if permission is granted
-
checkArchiveConversation
java.util.Optional<java.lang.String> checkArchiveConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)Evaluates the permissions for the given user when archiving an existing conversation.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation to be archived- Returns:
- the permission error message, if permission is denied to archive the conversation or no message, if permission is granted
-
checkReopenConversation
@Deprecated java.util.Optional<java.lang.String> checkReopenConversation(java.lang.String userId, java.lang.String conversationId)Deprecated.Evaluates the permissions for the given user when re-opening an archived conversation.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation to be re-opened- Returns:
- the permission error message, if permission is denied to re-open the conversation or no message, if permission is granted
-
checkReopenConversation
java.util.Optional<java.lang.String> checkReopenConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)Evaluates the permissions for the given user when re-opening an archived conversation.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation to be re-opened- Returns:
- the permission error message, if permission is denied to re-open the conversation or no message, if permission is granted
-
checkJoinParticipantToExistingConversation
@Deprecated java.util.Optional<java.lang.String> checkJoinParticipantToExistingConversation(java.lang.String userId, java.lang.String conversationId, java.lang.String newParticipantUserId)Deprecated.Evaluates the permissions for the given user when inviting a new participant to an existing conversation.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation to join the new participant to- Returns:
- the permission error message, if permission is denied to join the new participant or no message, if permission is granted
-
checkJoinParticipantToExistingConversation
java.util.Optional<java.lang.String> checkJoinParticipantToExistingConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String newParticipantUserId)Evaluates the permissions for the given user when inviting a new participant to an existing conversation.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation to join the new participant to- Returns:
- the permission error message, if permission is denied to join the new participant or no message, if permission is granted
-
checkDropParticipantFromConversation
@Deprecated java.util.Optional<java.lang.String> checkDropParticipantFromConversation(java.lang.String userId, java.lang.String conversationId, java.lang.String droppedParticipantUserId)Deprecated.Evaluates the permissions for the given user when dropping a participant from a conversation.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation from which the participant should be droppeddroppedParticipantUserId
- the id of the participant user to be dropped- Returns:
- the permission error message, if permission is denied to drop the participant or no message, if permission is granted
-
checkDropParticipantFromConversation
java.util.Optional<java.lang.String> checkDropParticipantFromConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String droppedParticipantUserId)Evaluates the permissions for the given user when dropping a participant from a conversation.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation from which the participant should be droppeddroppedParticipantUserId
- the id of the participant user to be dropped- Returns:
- the permission error message, if permission is denied to drop the participant or no message, if permission is granted
-
checkPostMessage
@Deprecated java.util.Optional<java.lang.String> checkPostMessage(java.lang.String userId, java.lang.String conversationId)Deprecated.Evaluates the permissions for the given user when posting a message to a conversation.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation to post the message to- Returns:
- the permission error message, if permission is denied to post a message or no message, if permission is granted
-
checkPostMessage
java.util.Optional<java.lang.String> checkPostMessage(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)Evaluates the permissions for the given user when posting a message to a conversation.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation to post the message to- Returns:
- the permission error message, if permission is denied to post a message or no message, if permission is granted
-
checkEditMessage
@Deprecated java.util.Optional<java.lang.String> checkEditMessage(java.lang.String userId, java.lang.String conversationId, java.lang.String messageId)Deprecated.Evaluates the permissions for the given user when editing an existing message of a conversation.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation to edit a message frommessageId
- the id of the message to be edited- Returns:
- the permission error message, if permission is denied to edit a message or no message, if permission is granted
-
checkEditMessage
java.util.Optional<java.lang.String> checkEditMessage(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String messageId)Evaluates the permissions for the given user when editing an existing message of a conversation.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation to edit a message frommessageId
- the id of the message to be edited- Returns:
- the permission error message, if permission is denied to edit a message or no message, if permission is granted
-
checkPostAction
@Deprecated default java.util.Optional<java.lang.String> checkPostAction(java.lang.String userId, java.lang.String conversationId, java.lang.String actionInstanceId, java.lang.String actionDefinitionId, java.lang.String actionDefinitionKey)Deprecated.Evaluates the permissions for the given user when posting an action message to a conversation. One ofactionInstanceId
,actionDefinitionId
oractionDefinitionKey
notnull
. If this method is not implemented it just invokescheckPostMessage(String, String)
- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the if of the conversation to post the message toactionInstanceId
- the id of the action instance that would be linked to the messageactionDefinitionId
- the id of the action definition that should be used for creating the action instance for the messageactionDefinitionKey
- the key of the action definition that should be used for creating the action instance for the message- Returns:
- the permissions error message, if it is not allowed to post the action,
Optional.empty()
if it is allowed
-
checkPostAction
default java.util.Optional<java.lang.String> checkPostAction(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String actionInstanceId, java.lang.String actionDefinitionId, java.lang.String actionDefinitionKey)Evaluates the permissions for the given user when posting an action message to a conversation. One ofactionInstanceId
,actionDefinitionId
oractionDefinitionKey
notnull
. If this method is not implemented it just invokescheckPostMessage(String, String)
- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the if of the conversation to post the message toactionInstanceId
- the id of the action instance that would be linked to the messageactionDefinitionId
- the id of the action definition that should be used for creating the action instance for the messageactionDefinitionKey
- the key of the action definition that should be used for creating the action instance for the message- Returns:
- the permissions error message, if it is not allowed to post the action,
Optional.empty()
if it is allowed
-
checkPostMedia
@Deprecated java.util.Optional<java.lang.String> checkPostMedia(java.lang.String userId, java.lang.String conversationId, java.lang.String mimeType)Deprecated.Evaluates the permissions for the given user when posing a media to a conversation.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation to post the media tomimeType
- the mime type of the media that is being posted- Returns:
- the permissions error message, if it is not allowed to the media,
Optional.empty()
if it is allowed
-
checkPostMedia
java.util.Optional<java.lang.String> checkPostMedia(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId, java.lang.String mimeType)Evaluates the permissions for the given user when posing a media to a conversation.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation to post the media tomimeType
- the mime type of the media that is being posted- Returns:
- the permissions error message, if it is not allowed to the media,
Optional.empty()
if it is allowed
-
checkUpdateConversationAvatar
@Deprecated java.util.Optional<java.lang.String> checkUpdateConversationAvatar(java.lang.String userId, java.lang.String conversationId)Deprecated.Evaluates the permissions for the given user when posing a media to a conversation.- Parameters:
userId
- the id of the user to check the permissionsconversationId
- the id of the conversation to post the media to- Returns:
- the permissions error message, if it is not allowed to the media,
Optional.empty()
if it is allowed
-
checkUpdateConversationAvatar
java.util.Optional<java.lang.String> checkUpdateConversationAvatar(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)Evaluates the permissions for the given user when posing a media to a conversation.- Parameters:
userId
- the id of the user to check the permissionsuserGroupKeys
- the group keys of the user to check the permissionsuserTenantId
- the tenant id of the user to check the permissionsconversationId
- the id of the conversation to post the media to- Returns:
- the permissions error message, if it is not allowed to the media,
Optional.empty()
if it is allowed
-
hasAccessToConversation
@Deprecated default boolean hasAccessToConversation(java.lang.String userId, java.lang.String conversationId)Deprecated. -
hasAccessToConversation
boolean hasAccessToConversation(java.lang.String userId, java.util.Collection<java.lang.String> userGroupKeys, java.lang.String userTenantId, java.lang.String conversationId)
-