Class DefaultShareManager

java.lang.Object
com.atlassian.jira.sharing.DefaultShareManager
All Implemented Interfaces:
ShareManager

public class DefaultShareManager extends Object implements ShareManager
Default implementation of the ShareManager.
Since:
v3.13
  • Constructor Details

  • Method Details

    • getSharePermissions

      public SharedEntity.SharePermissions getSharePermissions(SharedEntity entity)
      Description copied from interface: ShareManager
      Retrieve all SharePermission instances associated with a passed in SharedEntity
      Specified by:
      getSharePermissions in interface ShareManager
      Parameters:
      entity - The entity that has permissions associated with it
      Returns:
      A set of SharePermission instances associated with the entity.
    • deletePermissions

      public void deletePermissions(SharedEntity entity)
      Description copied from interface: ShareManager
      Delete all permissions associated with an entity
      Specified by:
      deletePermissions in interface ShareManager
      Parameters:
      entity - The entity that will have all its permissions deleted
    • deleteSharePermissionsLike

      public void deleteSharePermissionsLike(SharePermission permission)
      Description copied from interface: ShareManager
      Deletes SharePermission's that have the same "shape" as the provided share permission. It uses the type, param1, and param2 to as the basis for deleting SharePermission's.
      Specified by:
      deleteSharePermissionsLike in interface ShareManager
      Parameters:
      permission - a 'template' of the type of SharePermission you want to delete
    • updateSharePermissions

      public SharedEntity.SharePermissions updateSharePermissions(SharedEntity entity)
      Description copied from interface: ShareManager
      Updates the SharePermission associated with an entity. Looks after creation and updating of permissions.
      Specified by:
      updateSharePermissions in interface ShareManager
      Parameters:
      entity - The entity that has permissions associated with it
      Returns:
      The new SharePermissions associated with the entity
    • isSharedWith

      public boolean isSharedWith(ApplicationUser user, SharedEntity sharedEntity)
      Description copied from interface: ShareManager
      Whether this entity has been shared with the specified user.
      Specified by:
      isSharedWith in interface ShareManager
      Parameters:
      user - The user to check.
      sharedEntity - The entity to check.
      Returns:
      true if the entity has been shared with the user, or if the user owns the entity; otherwise, false.
    • isSharedWith

      public boolean isSharedWith(@Nullable ApplicationUser user, @Nonnull SharedEntity sharedEntity, @Nonnull ShareRight shareRight)
      Description copied from interface: ShareManager
      Checks if provided user has share rights for given entity.
      Specified by:
      isSharedWith in interface ShareManager
      Parameters:
      user - user which wants for example view or edit the entity
      sharedEntity - shared entity which permissions and ownership are going to be checked
      shareRight - share right which will be checked if user has it
      Returns:
      true in case provided user has specified rights for shared entity, false otherwise