Interface ShareManager

All Known Implementing Classes:
DefaultShareManager

public interface ShareManager
Interface for managing SharePermission objects.
Since:
v3.13
  • Method Details

    • getSharePermissions

      SharedEntity.SharePermissions getSharePermissions(SharedEntity entity)
      Retrieve all SharePermission instances associated with a passed in SharedEntity
      Parameters:
      entity - The entity that has permissions associated with it
      Returns:
      A set of SharePermission instances associated with the entity.
    • deletePermissions

      void deletePermissions(SharedEntity entity)
      Delete all permissions associated with an entity
      Parameters:
      entity - The entity that will have all its permissions deleted
    • updateSharePermissions

      SharedEntity.SharePermissions updateSharePermissions(SharedEntity entity)
      Updates the SharePermission associated with an entity. Looks after creation and updating of permissions.
      Parameters:
      entity - The entity that has permissions associated with it
      Returns:
      The new SharePermissions associated with the entity
    • isSharedWith

      boolean isSharedWith(ApplicationUser user, SharedEntity sharedEntity)
      Whether this entity has been shared with the specified user.
      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

      @ExperimentalApi boolean isSharedWith(@Nullable ApplicationUser user, @Nonnull SharedEntity sharedEntity, @Nonnull ShareRight shareRight)
      Checks if provided user has share rights for given entity.
      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
      Since:
      v7.12
    • deleteSharePermissionsLike

      void deleteSharePermissionsLike(SharePermission permission)
      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.
      Parameters:
      permission - a 'template' of the type of SharePermission you want to delete
      Throws:
      IllegalArgumentException - if you provide a null SharePermission or one that does not have a type and (param1 or param2).