public class

DefaultShareManager

extends Object
implements ShareManager
java.lang.Object
   ↳ com.atlassian.jira.sharing.DefaultShareManager

Class Overview

Default implementation of the ShareManager.

Summary

Public Constructors
DefaultShareManager(SharePermissionStore store, ShareTypeFactory shareTypeFactory, SharePermissionReindexer reindexer)
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)
Checks to see if the user has permission to see this SharedEntity
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.sharing.ShareManager

Public Constructors

public DefaultShareManager (SharePermissionStore store, ShareTypeFactory shareTypeFactory, SharePermissionReindexer reindexer)

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

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)

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