Class RemoteContentRestrictionServiceImpl
- java.lang.Object
-
- com.atlassian.confluence.rest.client.AbstractRemoteService<ContentRestrictionService>
-
- com.atlassian.confluence.rest.client.RemoteContentRestrictionServiceImpl
-
- All Implemented Interfaces:
RemoteContentRestrictionService
public class RemoteContentRestrictionServiceImpl extends AbstractRemoteService<ContentRestrictionService> implements RemoteContentRestrictionService
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
provider
-
-
Constructor Summary
Constructors Constructor Description RemoteContentRestrictionServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.atlassian.util.concurrent.Promise<Void>
addDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject)
Deprecated.since 7.0.1.CompletionStage<Void>
addDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject)
Adds singular directContentRestriction
foroperationKey
andsubject
to the content identified bycontentId
parameter.com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse>
addRestrictions(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions)
Deprecated.since 7.0.1.CompletionStage<ContentRestrictionsPageResponse>
addRestrictionsCompletionStage(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions)
Attempts to add all the restrictions specified to a piece of content identified bycontentId
.com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse>
deleteAllDirectRestrictions(ContentId target, Expansion... expansions)
Deprecated.since 7.0.1.CompletionStage<ContentRestrictionsPageResponse>
deleteAllDirectRestrictionsCompletionStage(ContentId target, Expansion... expansions)
Attempts to delete all the restrictions specified directly on a piece of content identified bycontentId
.com.atlassian.util.concurrent.Promise<Void>
deleteDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject)
Deprecated.since 7.0.1.CompletionStage<Void>
deleteDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject)
Deletes singular directContentRestriction
foroperationKey
andsubject
from the content identified bycontentId
parameter.com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse>
getRestrictions(ContentId target, PageRequest pageRequest, Expansion... expansions)
Deprecated.since 7.0.1.CompletionStage<ContentRestrictionsPageResponse>
getRestrictionsCompletionStage(ContentId target, PageRequest pageRequest, Expansion... expansions)
Retrieves all the restrictions for all the operations on a given Content.com.atlassian.util.concurrent.Promise<ContentRestriction>
getRestrictionsForOperation(ContentId target, OperationKey operationKey, PageRequest pageRequest, Expansion... expansions)
Deprecated.since 7.0.1.CompletionStage<ContentRestriction>
getRestrictionsForOperationCompletionStage(ContentId target, OperationKey operationKey, PageRequest pageRequest, Expansion... expansions)
Retrieves all restrictions for given operation key on given content.com.atlassian.util.concurrent.Promise<Map<OperationKey,ContentRestriction>>
getRestrictionsGroupByOperation(ContentId target, Expansion... expansions)
Deprecated.since 7.0.1.CompletionStage<Map<OperationKey,ContentRestriction>>
getRestrictionsGroupByOperationCompletionStage(ContentId target, Expansion... expansions)
List all restrictions that exist directly on the given content.com.atlassian.util.concurrent.Promise<Boolean>
hasDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject)
Deprecated.since 7.0.1.CompletionStage<Boolean>
hasDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject)
Returnstrue
if the User or Group specified by thesubject
parameter has restriction(s) for theoperationKey
operation which are specified directly on the Content identified bycontentId
parameter.com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse>
updateRestrictions(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions)
Deprecated.since 7.0.1.CompletionStage<ContentRestrictionsPageResponse>
updateRestrictionsCompletionStage(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions)
Sets all the restrictions specified to a piece of content identified bycontentId
, replacing any existing permissions.-
Methods inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
addExpansions, addPageRequest, addPageRequestParams, deleteCompletionStage, deleteCompletionStage, deleteFuture, deleteFuture, getCompletionStage, getCompletionStageGenericCollection, getCompletionStageMap, getCompletionStageMapOfPageResponses, getCompletionStageOptional, getCompletionStagePageResponseList, getCompletionStageSearchPageResponseList, getExecutor, getFuture, getFutureGenericCollection, getFutureMap, getFutureMapOfPageResponses, getFutureOption, getFuturePageResponseList, newExperimentalRestWebResource, newRestWebResource, postCompletionStage, postCompletionStage, postCompletionStage, postCompletionStageToPageResponse, postFuture, postFuture, postFuture, postFutureToPageResponse, putCompletionStage, putFuture
-
-
-
-
Constructor Detail
-
RemoteContentRestrictionServiceImpl
public RemoteContentRestrictionServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
-
-
Method Detail
-
getRestrictionsGroupByOperation
@Deprecated public com.atlassian.util.concurrent.Promise<Map<OperationKey,ContentRestriction>> getRestrictionsGroupByOperation(ContentId target, Expansion... expansions) throws ServiceException
Deprecated.since 7.0.1. UsegetRestrictionsGroupByOperationCompletionStage(ContentId, Expansion...)
instead.Description copied from interface:RemoteContentRestrictionService
List all restrictions that exist directly on the given content. Note that the subjects returned in each ContentRestriction are hard-limited to an arbitrary maximum size. Obtaining more can be done via theRemoteContentRestrictionService.getRestrictionsForOperation(com.atlassian.confluence.api.model.content.id.ContentId, com.atlassian.confluence.api.model.permissions.OperationKey, com.atlassian.confluence.api.model.pagination.PageRequest, com.atlassian.confluence.api.model.Expansion...)
method.- Specified by:
getRestrictionsGroupByOperation
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to look up permissions forexpansions
- the expansions to apply to the returned data. These expansions start from the operation itself.- Returns:
- a Map of all ContentRestrictions, grouped by operation key
- Throws:
ServiceException
-
getRestrictionsGroupByOperationCompletionStage
public CompletionStage<Map<OperationKey,ContentRestriction>> getRestrictionsGroupByOperationCompletionStage(ContentId target, Expansion... expansions) throws ServiceException
Description copied from interface:RemoteContentRestrictionService
List all restrictions that exist directly on the given content. Note that the subjects returned in each ContentRestriction are hard-limited to an arbitrary maximum size. Obtaining more can be done via theRemoteContentRestrictionService.getRestrictionsForOperation(com.atlassian.confluence.api.model.content.id.ContentId, com.atlassian.confluence.api.model.permissions.OperationKey, com.atlassian.confluence.api.model.pagination.PageRequest, com.atlassian.confluence.api.model.Expansion...)
method.- Specified by:
getRestrictionsGroupByOperationCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to look up permissions forexpansions
- the expansions to apply to the returned data. These expansions start from the operation itself.- Returns:
- a Map of all ContentRestrictions, grouped by operation key
- Throws:
ServiceException
-
getRestrictionsForOperation
@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestriction> getRestrictionsForOperation(ContentId target, OperationKey operationKey, PageRequest pageRequest, Expansion... expansions) throws ServiceException
Deprecated.since 7.0.1. UsegetRestrictionsForOperationCompletionStage(ContentId, OperationKey, PageRequest, Expansion...)
instead.Description copied from interface:RemoteContentRestrictionService
Retrieves all restrictions for given operation key on given content.- Specified by:
getRestrictionsForOperation
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to look up permissions foroperationKey
- the operation key to look up restrictions forpageRequest
- pagination through the subjects contained within the ContentRestrictionexpansions
- the expansions to the ContentRestriction.- Returns:
- ContentRestriction containing relevant restrictions for given operation key, or null if operation key does not have corresponding restrictions.
- Throws:
ServiceException
-
getRestrictionsForOperationCompletionStage
public CompletionStage<ContentRestriction> getRestrictionsForOperationCompletionStage(ContentId target, OperationKey operationKey, PageRequest pageRequest, Expansion... expansions) throws ServiceException
Description copied from interface:RemoteContentRestrictionService
Retrieves all restrictions for given operation key on given content.- Specified by:
getRestrictionsForOperationCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to look up permissions foroperationKey
- the operation key to look up restrictions forpageRequest
- pagination through the subjects contained within the ContentRestrictionexpansions
- the expansions to the ContentRestriction.- Returns:
- ContentRestriction containing relevant restrictions for given operation key, or null if operation key does not have corresponding restrictions.
- Throws:
ServiceException
-
getRestrictions
@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> getRestrictions(ContentId target, PageRequest pageRequest, Expansion... expansions) throws NotFoundException
Deprecated.since 7.0.1. UsegetRestrictionsCompletionStage(ContentId, PageRequest, Expansion...)
instead.Description copied from interface:RemoteContentRestrictionService
Retrieves all the restrictions for all the operations on a given Content.- Specified by:
getRestrictions
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to look up permissions forpageRequest
- pagination through the list of all the ContentRestrictions returnedexpansions
- the expansions to the ContentRestriction- Returns:
- a paginated response, containing all the ContentRestrictions for the given content
- Throws:
NotFoundException
- if given content id does not exist, or is not viewable by user
-
getRestrictionsCompletionStage
public CompletionStage<ContentRestrictionsPageResponse> getRestrictionsCompletionStage(ContentId target, PageRequest pageRequest, Expansion... expansions) throws NotFoundException
Description copied from interface:RemoteContentRestrictionService
Retrieves all the restrictions for all the operations on a given Content.- Specified by:
getRestrictionsCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to look up permissions forpageRequest
- pagination through the list of all the ContentRestrictions returnedexpansions
- the expansions to the ContentRestriction- Returns:
- a paginated response, containing all the ContentRestrictions for the given content
- Throws:
NotFoundException
- if given content id does not exist, or is not viewable by user
-
updateRestrictions
@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> updateRestrictions(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions) throws ServiceException
Deprecated.since 7.0.1. UseupdateRestrictionsCompletionStage(ContentId, Collection, Expansion...)
instead.Description copied from interface:RemoteContentRestrictionService
Sets all the restrictions specified to a piece of content identified bycontentId
, replacing any existing permissions. Setting per-content restrictions is currently allowed for Pages or BlogPosts only.Rules of applying restrictions via this method:
- Provided collection of
ContentRestriction
s is allowed to have only 1 (ONE)ContentRestriction
object for each operation. - Provided ContentRestrictions will replace (overwrite) any pre-existing restrictions on the Content under the corresponding operations.
- In case provided collection of ContentRestriction does not have any of the operations supported it is assumed that restrictions for such operation should not be changed at all.
- Restrictions with the "users" and/or "groups" map entries explicitly set to be empty arrays will result in removing corresponding restrictions for the content.
- Restrictions with the "users" and/or "groups" map entries missing will result in not changing corresponding operation's user/group restrictions for the content.
- It is not allowed to edit the restrictions in such a way which would remove requesting user's access.
- Only Page, BlogPost and other add-on provided Content Types that support direct content restrictions are supported.
- Specified by:
updateRestrictions
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to assign restrictions tocontentRestrictions
- Collection ofContentRestriction
s to apply to the Content specifiedexpansions
- the expansions to the ContentRestriction. To be expanded on response.- Returns:
ContentRestrictionsPageResponse
describing the new state of the content identified bycontentId
(same asRemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...)
would return)- Throws:
ServiceException
- or one of it subtypes.NotFoundException
- in case there's no Content with ID provided or user does not have enough rights to view itPermissionException
- in case user is not allowed to alter restrictions on the content specifiedBadRequestException
- in case when data supplied is not enough/corrupt, etc... many reasons. Exception generally would have message which explains what's wrong.
- Provided collection of
-
updateRestrictionsCompletionStage
public CompletionStage<ContentRestrictionsPageResponse> updateRestrictionsCompletionStage(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions) throws ServiceException
Description copied from interface:RemoteContentRestrictionService
Sets all the restrictions specified to a piece of content identified bycontentId
, replacing any existing permissions. Setting per-content restrictions is currently allowed for Pages or BlogPosts only.Rules of applying restrictions via this method:
- Provided collection of
ContentRestriction
s is allowed to have only 1 (ONE)ContentRestriction
object for each operation. - Provided ContentRestrictions will replace (overwrite) any pre-existing restrictions on the Content under the corresponding operations.
- In case provided collection of ContentRestriction does not have any of the operations supported it is assumed that restrictions for such operation should not be changed at all.
- Restrictions with the "users" and/or "groups" map entries explicitly set to be empty arrays will result in removing corresponding restrictions for the content.
- Restrictions with the "users" and/or "groups" map entries missing will result in not changing corresponding operation's user/group restrictions for the content.
- It is not allowed to edit the restrictions in such a way which would remove requesting user's access.
- Only Page, BlogPost and other add-on provided Content Types that support direct content restrictions are supported.
- Specified by:
updateRestrictionsCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to assign restrictions tocontentRestrictions
- Collection ofContentRestriction
s to apply to the Content specifiedexpansions
- the expansions to the ContentRestriction. To be expanded on response.- Returns:
ContentRestrictionsPageResponse
describing the new state of the content identified bycontentId
(same asRemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...)
would return)- Throws:
ServiceException
- or one of it subtypes.NotFoundException
- in case there's no Content with ID provided or user does not have enough rights to view itPermissionException
- in case user is not allowed to alter restrictions on the content specifiedBadRequestException
- in case when data supplied is not enough/corrupt, etc... many reasons. Exception generally would have message which explains what's wrong.
- Provided collection of
-
addRestrictions
@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> addRestrictions(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions) throws ServiceException
Deprecated.since 7.0.1. UseaddRestrictionsCompletionStage(ContentId, Collection, Expansion...)
instead.Description copied from interface:RemoteContentRestrictionService
Attempts to add all the restrictions specified to a piece of content identified bycontentId
. Does not replace/remove/alter any pre-existingContentRestriction
s. ProvidedContentRestriction
s will be added, i.e. "merged with" any pre-existing restrictions on the Content under the corresponding operations. Changing per-content restrictions is currently allowed for Pages or BlogPosts only.Rules of applying restrictions via this method:
- Provided collection of
ContentRestriction
s is allowed to have only 1 (ONE)ContentRestriction
object for each operation. - Provided ContentRestrictions will be added, i.e. "merged with" any pre-existing restrictions on the Content under the corresponding operations.
- In case provided collection of ContentRestriction does not have any of the operations supported no changes will happen.
- Restrictions with the "users" and/or "groups" map entries explicitly set to be empty arrays will result in not changing corresponding operation's user/group restrictions for the content.
- Restrictions with the "users" and/or "groups" map entries missing will result in not changing corresponding operation's user/group restrictions for the content.
- It is not allowed to edit the restrictions in such a way which would remove requesting user's access.
- Only Page, BlogPost and other add-on provided Content Types that support direct content restrictions are supported.
- Specified by:
addRestrictions
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to add restrictions tocontentRestrictions
- Collection ofContentRestriction
s to apply to the Content specifiedexpansions
- the expansions to the ContentRestriction. To be expanded on response.- Returns:
ContentRestrictionsPageResponse
describing the new state of the content identified bycontentId
(same asRemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...)
would return)- Throws:
ServiceException
- or one of it subtypes.NotFoundException
- in case there's no Content with ID provided or user does not have enough rights to view itPermissionException
- in case user is not allowed to alter restrictions on the content specifiedBadRequestException
- in case when data supplied is not enough/corrupt, etc... many reasons. Exception generally would have message which explains what's wrong.
- Provided collection of
-
addRestrictionsCompletionStage
public CompletionStage<ContentRestrictionsPageResponse> addRestrictionsCompletionStage(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions) throws ServiceException
Description copied from interface:RemoteContentRestrictionService
Attempts to add all the restrictions specified to a piece of content identified bycontentId
. Does not replace/remove/alter any pre-existingContentRestriction
s. ProvidedContentRestriction
s will be added, i.e. "merged with" any pre-existing restrictions on the Content under the corresponding operations. Changing per-content restrictions is currently allowed for Pages or BlogPosts only.Rules of applying restrictions via this method:
- Provided collection of
ContentRestriction
s is allowed to have only 1 (ONE)ContentRestriction
object for each operation. - Provided ContentRestrictions will be added, i.e. "merged with" any pre-existing restrictions on the Content under the corresponding operations.
- In case provided collection of ContentRestriction does not have any of the operations supported no changes will happen.
- Restrictions with the "users" and/or "groups" map entries explicitly set to be empty arrays will result in not changing corresponding operation's user/group restrictions for the content.
- Restrictions with the "users" and/or "groups" map entries missing will result in not changing corresponding operation's user/group restrictions for the content.
- It is not allowed to edit the restrictions in such a way which would remove requesting user's access.
- Only Page, BlogPost and other add-on provided Content Types that support direct content restrictions are supported.
- Specified by:
addRestrictionsCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to add restrictions tocontentRestrictions
- Collection ofContentRestriction
s to apply to the Content specifiedexpansions
- the expansions to the ContentRestriction. To be expanded on response.- Returns:
ContentRestrictionsPageResponse
describing the new state of the content identified bycontentId
(same asRemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...)
would return)- Throws:
ServiceException
- or one of it subtypes.NotFoundException
- in case there's no Content with ID provided or user does not have enough rights to view itPermissionException
- in case user is not allowed to alter restrictions on the content specifiedBadRequestException
- in case when data supplied is not enough/corrupt, etc... many reasons. Exception generally would have message which explains what's wrong.
- Provided collection of
-
deleteAllDirectRestrictions
@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> deleteAllDirectRestrictions(ContentId target, Expansion... expansions) throws ServiceException
Deprecated.since 7.0.1. UsedeleteAllDirectRestrictionsCompletionStage(ContentId, Expansion...)
instead.Description copied from interface:RemoteContentRestrictionService
Attempts to delete all the restrictions specified directly on a piece of content identified bycontentId
. "specified directly" means that deleting restrictions on some content won't affect any restrictions inherited from its parents. Changing per-content restrictions is currently allowed for Pages, Blog Posts and other add-on provided Content Types that support direct content restrictions.- Specified by:
deleteAllDirectRestrictions
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to remove all directly specified restrictions fromexpansions
- the expansions to the ContentRestriction. To be expanded on response.- Returns:
ContentRestrictionsPageResponse
describing the new state of the content identified bycontentId
(same asRemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...)
would return)- Throws:
ServiceException
- or one of it subtypes.NotFoundException
- in case there's no Content with ID provided or user does not have enough rights to view itPermissionException
- in case user is not allowed to alter restrictions on the content specified
-
deleteAllDirectRestrictionsCompletionStage
public CompletionStage<ContentRestrictionsPageResponse> deleteAllDirectRestrictionsCompletionStage(ContentId target, Expansion... expansions) throws ServiceException
Description copied from interface:RemoteContentRestrictionService
Attempts to delete all the restrictions specified directly on a piece of content identified bycontentId
. "specified directly" means that deleting restrictions on some content won't affect any restrictions inherited from its parents. Changing per-content restrictions is currently allowed for Pages, Blog Posts and other add-on provided Content Types that support direct content restrictions.- Specified by:
deleteAllDirectRestrictionsCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
target
- the id of the content to remove all directly specified restrictions fromexpansions
- the expansions to the ContentRestriction. To be expanded on response.- Returns:
ContentRestrictionsPageResponse
describing the new state of the content identified bycontentId
(same asRemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...)
would return)- Throws:
ServiceException
- or one of it subtypes.NotFoundException
- in case there's no Content with ID provided or user does not have enough rights to view itPermissionException
- in case user is not allowed to alter restrictions on the content specified
-
hasDirectRestrictionForSubject
@Deprecated public com.atlassian.util.concurrent.Promise<Boolean> hasDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
Deprecated.since 7.0.1. UsehasDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject)
instead.Description copied from interface:RemoteContentRestrictionService
Returnstrue
if the User or Group specified by thesubject
parameter has restriction(s) for theoperationKey
operation which are specified directly on the Content identified bycontentId
parameter.Returns
false
otherwise.Can throw
BadRequestException
orPermissionException
and other various subtypes ofServiceException
in case of bad IDs, parameters, permission problems, etc.- Specified by:
hasDirectRestrictionForSubject
in interfaceRemoteContentRestrictionService
- Parameters:
contentId
- the id of the content which the check will be performed onoperationKey
- the operation key to check restrictions againstsubject
- eitherUser
orGroup
who's restriction is in question- Returns:
true
orfalse
depending on whether user/group specified have any direct restrictions on a content specified- Throws:
ServiceException
- or one of it subtypes.NotFoundException
- in case there's no Content with ID provided or user does not have enough rights to view it
-
hasDirectRestrictionForSubjectCompletionStage
public CompletionStage<Boolean> hasDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
Description copied from interface:RemoteContentRestrictionService
Returnstrue
if the User or Group specified by thesubject
parameter has restriction(s) for theoperationKey
operation which are specified directly on the Content identified bycontentId
parameter.Returns
false
otherwise.Can throw
BadRequestException
orPermissionException
and other various subtypes ofServiceException
in case of bad IDs, parameters, permission problems, etc.- Specified by:
hasDirectRestrictionForSubjectCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
contentId
- the id of the content which the check will be performed onoperationKey
- the operation key to check restrictions againstsubject
- eitherUser
orGroup
who's restriction is in question- Returns:
true
orfalse
depending on whether user/group specified have any direct restrictions on a content specified- Throws:
ServiceException
- or one of it subtypes.NotFoundException
- in case there's no Content with ID provided or user does not have enough rights to view it
-
deleteDirectRestrictionForSubject
@Deprecated public com.atlassian.util.concurrent.Promise<Void> deleteDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
Deprecated.since 7.0.1. UsedeleteDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject)
instead.Description copied from interface:RemoteContentRestrictionService
Deletes singular directContentRestriction
foroperationKey
andsubject
from the content identified bycontentId
parameter. Throws subclasses ofServiceException
in case of various problems (cannot find content, restrictions to be deleted does not exist, etc...)- Specified by:
deleteDirectRestrictionForSubject
in interfaceRemoteContentRestrictionService
- Parameters:
contentId
- the id of the content which the restriction to be removed fromoperationKey
- the operation to remove restriction forsubject
- eitherUser
orGroup
who's restriction is to be deleted- Throws:
ServiceException
-
deleteDirectRestrictionForSubjectCompletionStage
public CompletionStage<Void> deleteDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
Description copied from interface:RemoteContentRestrictionService
Deletes singular directContentRestriction
foroperationKey
andsubject
from the content identified bycontentId
parameter. Throws subclasses ofServiceException
in case of various problems (cannot find content, restrictions to be deleted does not exist, etc...)- Specified by:
deleteDirectRestrictionForSubjectCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
contentId
- the id of the content which the restriction to be removed fromoperationKey
- the operation to remove restriction forsubject
- eitherUser
orGroup
who's restriction is to be deleted- Throws:
ServiceException
-
addDirectRestrictionForSubject
@Deprecated public com.atlassian.util.concurrent.Promise<Void> addDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
Deprecated.since 7.0.1. UseaddDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject)
instead.Description copied from interface:RemoteContentRestrictionService
Adds singular directContentRestriction
foroperationKey
andsubject
to the content identified bycontentId
parameter. Throws subclasses ofServiceException
in case of various problems (cannot find content, wrong operationKey, restricting self, etc...)- Specified by:
addDirectRestrictionForSubject
in interfaceRemoteContentRestrictionService
- Parameters:
contentId
- the id of the content which the restriction to be added tooperationKey
- the operation to remove restriction forsubject
- eitherUser
orGroup
who's restriction is to be added- Throws:
ServiceException
-
addDirectRestrictionForSubjectCompletionStage
public CompletionStage<Void> addDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
Description copied from interface:RemoteContentRestrictionService
Adds singular directContentRestriction
foroperationKey
andsubject
to the content identified bycontentId
parameter. Throws subclasses ofServiceException
in case of various problems (cannot find content, wrong operationKey, restricting self, etc...)- Specified by:
addDirectRestrictionForSubjectCompletionStage
in interfaceRemoteContentRestrictionService
- Parameters:
contentId
- the id of the content which the restriction to be added tooperationKey
- the operation to remove restriction forsubject
- eitherUser
orGroup
who's restriction is to be added- Throws:
ServiceException
-
-