com.atlassian.jira.sharing
Class DefaultShareManager

java.lang.Object
  extended by 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 Summary
DefaultShareManager(SharePermissionStore store, ShareTypeFactory shareTypeFactory, SharePermissionReindexer reindexer)
           
 
Method Summary
 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
 boolean hasPermission(com.atlassian.crowd.embedded.api.User user, SharedEntity entity)
          Deprecated. 
 boolean isSharedWith(com.atlassian.crowd.embedded.api.User 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultShareManager

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

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

hasPermission

@Deprecated
public boolean hasPermission(com.atlassian.crowd.embedded.api.User user,
                                        SharedEntity entity)
Deprecated. 

Description copied from interface: ShareManager
Checks to see if the user has permission to see this SharedEntity

Specified by:
hasPermission in interface ShareManager
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.

isSharedWith

public boolean isSharedWith(com.atlassian.crowd.embedded.api.User 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.


Copyright © 2002-2012 Atlassian. All Rights Reserved.