com.atlassian.jira.sharing
Interface ShareManager

All Known Implementing Classes:
DefaultShareManager

public interface ShareManager

Interface for managing SharePermission objects.

Since:
v3.13

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.opensymphony.user.User user, SharedEntity entity)
          Checks to see if the user has permission to see this SharedEntity
 SharedEntity.SharePermissions updateSharePermissions(SharedEntity entity)
          Updates the SharePermission associated with an entity.
 

Method Detail

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

hasPermission

boolean hasPermission(com.opensymphony.user.User 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.

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:
java.lang.IllegalArgumentException - if you provide a null SharePermission or one that does not have a type and (param1 or param2).


Copyright © 2002-2010 Atlassian. All Rights Reserved.