public interface

ShareManager

com.atlassian.jira.sharing.ShareManager
Known Indirect Subclasses

Class Overview

Interface for managing SharePermission objects.

Summary

Public Methods
void deletePermissions(SharedEntity entity)
Delete all permissions associated with an entity
void deleteSharePermissionsLike(SharePermission permission)
Deletes SharePermission's that have the same "shape" as the provided share permission.
SharedEntity.SharePermissions getSharePermissions(SharedEntity entity)
Retrieve all SharePermission instances associated with a passed in SharedEntity
@Deprecated boolean hasPermission(ApplicationUser user, SharedEntity entity)
This method is deprecated. since 5.0 please use #isSharedWith(com.atlassian.crowd.embedded.api.User, SharedEntity) to get the same logic. Permission checks should be done in the service layer according to this information.
boolean isSharedWith(ApplicationUser user, SharedEntity sharedEntity)
Whether this entity has been shared with the specified user.
SharedEntity.SharePermissions updateSharePermissions(SharedEntity entity)
Updates the SharePermission associated with an entity.

Public Methods

public void deletePermissions (SharedEntity entity)

Delete all permissions associated with an entity

Parameters
entity The entity that will have all its permissions deleted

public 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).

public 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

@Deprecated public boolean hasPermission (ApplicationUser user, SharedEntity entity)

This method is deprecated.
since 5.0 please use #isSharedWith(com.atlassian.crowd.embedded.api.User, SharedEntity) to get the same logic. Permission checks should be done in the service layer according to this information.

Checks to see if the user has permission to see this SharedEntity

Parameters
user The user to check permissions for
entity The entity that has permissions associated with it
Returns
  • returns true if the user has appropriate permissions, otherwise false.

public 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.

public 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