public class DefaultShareManager extends Object implements ShareManager
ShareManager
.Constructor and Description |
---|
DefaultShareManager(SharePermissionStore store,
ShareTypeFactory shareTypeFactory,
SharePermissionReindexer reindexer,
FeatureManager featureManager,
GlobalPermissionManager globalPermissionManager) |
Modifier and Type | Method and Description |
---|---|
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(ApplicationUser user,
SharedEntity entity)
Deprecated.
|
boolean |
isSharedWith(ApplicationUser user,
SharedEntity sharedEntity)
Whether this entity has been shared with the specified user.
|
boolean |
isSharedWith(ApplicationUser user,
SharedEntity sharedEntity,
ShareRight shareRight)
Checks if provided user has share rights for given entity.
|
SharedEntity.SharePermissions |
updateSharePermissions(SharedEntity entity)
Updates the
SharePermission associated with an entity. |
public DefaultShareManager(SharePermissionStore store, ShareTypeFactory shareTypeFactory, SharePermissionReindexer reindexer, FeatureManager featureManager, GlobalPermissionManager globalPermissionManager)
public SharedEntity.SharePermissions getSharePermissions(SharedEntity entity)
ShareManager
SharePermission
instances associated with a passed in
SharedEntity
getSharePermissions
in interface ShareManager
entity
- The entity that has permissions associated with itSharePermission
instances associated with the entity.public void deletePermissions(SharedEntity entity)
ShareManager
deletePermissions
in interface ShareManager
entity
- The entity that will have all its permissions deletedpublic void deleteSharePermissionsLike(SharePermission permission)
ShareManager
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.deleteSharePermissionsLike
in interface ShareManager
permission
- a 'template' of the type of SharePermission you want to deletepublic SharedEntity.SharePermissions updateSharePermissions(SharedEntity entity)
ShareManager
SharePermission
associated with an entity. Looks after creation and updating of permissions.updateSharePermissions
in interface ShareManager
entity
- The entity that has permissions associated with it@Deprecated public boolean hasPermission(ApplicationUser user, SharedEntity entity)
ShareManager
SharedEntity
hasPermission
in interface ShareManager
user
- The user to check permissions forentity
- The entity that has permissions associated with itpublic boolean isSharedWith(ApplicationUser user, SharedEntity sharedEntity)
ShareManager
isSharedWith
in interface ShareManager
user
- The user to check.sharedEntity
- The entity to check.public boolean isSharedWith(@Nullable ApplicationUser user, @Nonnull SharedEntity sharedEntity, @Nonnull ShareRight shareRight)
ShareManager
isSharedWith
in interface ShareManager
user
- user which wants for example view or edit the entitysharedEntity
- shared entity which permissions and ownership are going to be checkedshareRight
- share right which will be checked if user has itCopyright © 2002-2022 Atlassian. All Rights Reserved.