public class RemoteContentRestrictionServiceImpl extends AbstractRemoteService<ContentRestrictionService> implements RemoteContentRestrictionService
provider| Constructor and Description |
|---|
RemoteContentRestrictionServiceImpl(AuthenticatedWebResourceProvider provider,
com.google.common.util.concurrent.ListeningExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
com.atlassian.util.concurrent.Promise<Void> |
addDirectRestrictionForSubject(ContentId contentId,
OperationKey operationKey,
Subject subject)
Deprecated.
since 7.0.1. Use
addDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject) instead. |
CompletionStage<Void> |
addDirectRestrictionForSubjectCompletionStage(ContentId contentId,
OperationKey operationKey,
Subject subject)
Adds singular direct
ContentRestriction for operationKey and subject to the content identified by contentId parameter. |
com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> |
addRestrictions(ContentId target,
Collection<? extends ContentRestriction> contentRestrictions,
Expansion... expansions)
Deprecated.
since 7.0.1. Use
addRestrictionsCompletionStage(ContentId, Collection, Expansion...) instead. |
CompletionStage<ContentRestrictionsPageResponse> |
addRestrictionsCompletionStage(ContentId target,
Collection<? extends ContentRestriction> contentRestrictions,
Expansion... expansions)
Attempts to add all the restrictions specified to a piece of content identified by
contentId. |
com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> |
deleteAllDirectRestrictions(ContentId target,
Expansion... expansions)
Deprecated.
since 7.0.1. Use
deleteAllDirectRestrictionsCompletionStage(ContentId, Expansion...) instead. |
CompletionStage<ContentRestrictionsPageResponse> |
deleteAllDirectRestrictionsCompletionStage(ContentId target,
Expansion... expansions)
Attempts to delete all the restrictions specified directly on a piece of content identified by
contentId. |
com.atlassian.util.concurrent.Promise<Void> |
deleteDirectRestrictionForSubject(ContentId contentId,
OperationKey operationKey,
Subject subject)
Deprecated.
since 7.0.1. Use
deleteDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject) instead. |
CompletionStage<Void> |
deleteDirectRestrictionForSubjectCompletionStage(ContentId contentId,
OperationKey operationKey,
Subject subject)
Deletes singular direct
ContentRestriction for operationKey and subject from the content identified by contentId parameter. |
com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> |
getRestrictions(ContentId target,
PageRequest pageRequest,
Expansion... expansions)
Deprecated.
since 7.0.1. Use
getRestrictionsCompletionStage(ContentId, PageRequest, Expansion...) instead. |
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. Use
getRestrictionsForOperationCompletionStage(ContentId, OperationKey, PageRequest, Expansion...) instead. |
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. Use
getRestrictionsGroupByOperationCompletionStage(ContentId, Expansion...) instead. |
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. Use
hasDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject) instead. |
CompletionStage<Boolean> |
hasDirectRestrictionForSubjectCompletionStage(ContentId contentId,
OperationKey operationKey,
Subject subject)
Returns
true if the User or Group specified by the subject parameter has restriction(s) for the operationKey operation
which are specified directly on the Content identified by contentId parameter. |
com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> |
updateRestrictions(ContentId target,
Collection<? extends ContentRestriction> contentRestrictions,
Expansion... expansions)
Deprecated.
since 7.0.1. Use
updateRestrictionsCompletionStage(ContentId, Collection, Expansion...) instead. |
CompletionStage<ContentRestrictionsPageResponse> |
updateRestrictionsCompletionStage(ContentId target,
Collection<? extends ContentRestriction> contentRestrictions,
Expansion... expansions)
Sets all the restrictions specified to a piece of content identified by
contentId, replacing any existing permissions. |
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, putFuturepublic RemoteContentRestrictionServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
@Deprecated public com.atlassian.util.concurrent.Promise<Map<OperationKey,ContentRestriction>> getRestrictionsGroupByOperation(ContentId target, Expansion... expansions) throws ServiceException
getRestrictionsGroupByOperationCompletionStage(ContentId, Expansion...) instead.RemoteContentRestrictionServiceRemoteContentRestrictionService.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.getRestrictionsGroupByOperation in interface RemoteContentRestrictionServicetarget - 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.ServiceExceptionpublic CompletionStage<Map<OperationKey,ContentRestriction>> getRestrictionsGroupByOperationCompletionStage(ContentId target, Expansion... expansions) throws ServiceException
RemoteContentRestrictionServiceRemoteContentRestrictionService.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.getRestrictionsGroupByOperationCompletionStage in interface RemoteContentRestrictionServicetarget - 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.ServiceException@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestriction> getRestrictionsForOperation(ContentId target, OperationKey operationKey, PageRequest pageRequest, Expansion... expansions) throws ServiceException
getRestrictionsForOperationCompletionStage(ContentId, OperationKey, PageRequest, Expansion...) instead.RemoteContentRestrictionServicegetRestrictionsForOperation in interface RemoteContentRestrictionServicetarget - 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.ServiceExceptionpublic CompletionStage<ContentRestriction> getRestrictionsForOperationCompletionStage(ContentId target, OperationKey operationKey, PageRequest pageRequest, Expansion... expansions) throws ServiceException
RemoteContentRestrictionServicegetRestrictionsForOperationCompletionStage in interface RemoteContentRestrictionServicetarget - 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.ServiceException@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> getRestrictions(ContentId target, PageRequest pageRequest, Expansion... expansions) throws NotFoundException
getRestrictionsCompletionStage(ContentId, PageRequest, Expansion...) instead.RemoteContentRestrictionServicegetRestrictions in interface RemoteContentRestrictionServicetarget - the id of the content to look up permissions forpageRequest - pagination through the list of all the ContentRestrictions returnedexpansions - the expansions to the ContentRestrictionNotFoundException - if given content id does not exist, or is not viewable by userpublic CompletionStage<ContentRestrictionsPageResponse> getRestrictionsCompletionStage(ContentId target, PageRequest pageRequest, Expansion... expansions) throws NotFoundException
RemoteContentRestrictionServicegetRestrictionsCompletionStage in interface RemoteContentRestrictionServicetarget - the id of the content to look up permissions forpageRequest - pagination through the list of all the ContentRestrictions returnedexpansions - the expansions to the ContentRestrictionNotFoundException - if given content id does not exist, or is not viewable by user@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> updateRestrictions(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions) throws ServiceException
updateRestrictionsCompletionStage(ContentId, Collection, Expansion...) instead.RemoteContentRestrictionServicecontentId, replacing any existing permissions.
Setting per-content restrictions is currently allowed for Pages or BlogPosts only.
Rules of applying restrictions via this method:
ContentRestrictions is allowed to have only 1 (ONE) ContentRestriction object for each operation.updateRestrictions in interface RemoteContentRestrictionServicetarget - the id of the content to assign restrictions tocontentRestrictions - Collection of ContentRestrictions to apply to the Content specifiedexpansions - the expansions to the ContentRestriction. To be expanded on response.ContentRestrictionsPageResponse describing the new state of the content identified by contentId (same as RemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...) would return)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.public CompletionStage<ContentRestrictionsPageResponse> updateRestrictionsCompletionStage(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions) throws ServiceException
RemoteContentRestrictionServicecontentId, replacing any existing permissions.
Setting per-content restrictions is currently allowed for Pages or BlogPosts only.
Rules of applying restrictions via this method:
ContentRestrictions is allowed to have only 1 (ONE) ContentRestriction object for each operation.updateRestrictionsCompletionStage in interface RemoteContentRestrictionServicetarget - the id of the content to assign restrictions tocontentRestrictions - Collection of ContentRestrictions to apply to the Content specifiedexpansions - the expansions to the ContentRestriction. To be expanded on response.ContentRestrictionsPageResponse describing the new state of the content identified by contentId (same as RemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...) would return)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.@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> addRestrictions(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions) throws ServiceException
addRestrictionsCompletionStage(ContentId, Collection, Expansion...) instead.RemoteContentRestrictionServicecontentId.
Does not replace/remove/alter any pre-existing ContentRestrictions.
Provided ContentRestrictions 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:
ContentRestrictions is allowed to have only 1 (ONE) ContentRestriction object for each operation.addRestrictions in interface RemoteContentRestrictionServicetarget - the id of the content to add restrictions tocontentRestrictions - Collection of ContentRestrictions to apply to the Content specifiedexpansions - the expansions to the ContentRestriction. To be expanded on response.ContentRestrictionsPageResponse describing the new state of the content identified by contentId (same as RemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...) would return)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.public CompletionStage<ContentRestrictionsPageResponse> addRestrictionsCompletionStage(ContentId target, Collection<? extends ContentRestriction> contentRestrictions, Expansion... expansions) throws ServiceException
RemoteContentRestrictionServicecontentId.
Does not replace/remove/alter any pre-existing ContentRestrictions.
Provided ContentRestrictions 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:
ContentRestrictions is allowed to have only 1 (ONE) ContentRestriction object for each operation.addRestrictionsCompletionStage in interface RemoteContentRestrictionServicetarget - the id of the content to add restrictions tocontentRestrictions - Collection of ContentRestrictions to apply to the Content specifiedexpansions - the expansions to the ContentRestriction. To be expanded on response.ContentRestrictionsPageResponse describing the new state of the content identified by contentId (same as RemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...) would return)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.@Deprecated public com.atlassian.util.concurrent.Promise<ContentRestrictionsPageResponse> deleteAllDirectRestrictions(ContentId target, Expansion... expansions) throws ServiceException
deleteAllDirectRestrictionsCompletionStage(ContentId, Expansion...) instead.RemoteContentRestrictionServicecontentId.
"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.deleteAllDirectRestrictions in interface RemoteContentRestrictionServicetarget - the id of the content to remove all directly specified restrictions fromexpansions - the expansions to the ContentRestriction. To be expanded on response.ContentRestrictionsPageResponse describing the new state of the content identified by contentId (same as RemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...) would return)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 specifiedpublic CompletionStage<ContentRestrictionsPageResponse> deleteAllDirectRestrictionsCompletionStage(ContentId target, Expansion... expansions) throws ServiceException
RemoteContentRestrictionServicecontentId.
"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.deleteAllDirectRestrictionsCompletionStage in interface RemoteContentRestrictionServicetarget - the id of the content to remove all directly specified restrictions fromexpansions - the expansions to the ContentRestriction. To be expanded on response.ContentRestrictionsPageResponse describing the new state of the content identified by contentId (same as RemoteContentRestrictionService.getRestrictions(ContentId, PageRequest, Expansion...) would return)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@Deprecated public com.atlassian.util.concurrent.Promise<Boolean> hasDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
hasDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject) instead.RemoteContentRestrictionServicetrue if the User or Group specified by the subject parameter has restriction(s) for the operationKey operation
which are specified directly on the Content identified by contentId parameter.
Returns false otherwise.
Can throw BadRequestException or PermissionException and other various subtypes of ServiceException in case of bad IDs, parameters, permission problems, etc.
hasDirectRestrictionForSubject in interface RemoteContentRestrictionServicecontentId - the id of the content which the check will be performed onoperationKey - the operation key to check restrictions againstsubject - either User or Group who's restriction is in questiontrue or false depending on whether user/group specified have any direct restrictions on a content specifiedServiceException - or one of it subtypes.NotFoundException - in case there's no Content with ID provided or user does not have enough rights to view itpublic CompletionStage<Boolean> hasDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
RemoteContentRestrictionServicetrue if the User or Group specified by the subject parameter has restriction(s) for the operationKey operation
which are specified directly on the Content identified by contentId parameter.
Returns false otherwise.
Can throw BadRequestException or PermissionException and other various subtypes of ServiceException in case of bad IDs, parameters, permission problems, etc.
hasDirectRestrictionForSubjectCompletionStage in interface RemoteContentRestrictionServicecontentId - the id of the content which the check will be performed onoperationKey - the operation key to check restrictions againstsubject - either User or Group who's restriction is in questiontrue or false depending on whether user/group specified have any direct restrictions on a content specifiedServiceException - 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@Deprecated public com.atlassian.util.concurrent.Promise<Void> deleteDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
deleteDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject) instead.RemoteContentRestrictionServiceContentRestriction for operationKey and subject from the content identified by contentId parameter.
Throws subclasses of ServiceException in case of various problems (cannot find content, restrictions to be deleted does not exist, etc...)deleteDirectRestrictionForSubject in interface RemoteContentRestrictionServicecontentId - the id of the content which the restriction to be removed fromoperationKey - the operation to remove restriction forsubject - either User or Group who's restriction is to be deletedServiceExceptionpublic CompletionStage<Void> deleteDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
RemoteContentRestrictionServiceContentRestriction for operationKey and subject from the content identified by contentId parameter.
Throws subclasses of ServiceException in case of various problems (cannot find content, restrictions to be deleted does not exist, etc...)deleteDirectRestrictionForSubjectCompletionStage in interface RemoteContentRestrictionServicecontentId - the id of the content which the restriction to be removed fromoperationKey - the operation to remove restriction forsubject - either User or Group who's restriction is to be deletedServiceException@Deprecated public com.atlassian.util.concurrent.Promise<Void> addDirectRestrictionForSubject(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
addDirectRestrictionForSubjectCompletionStage(ContentId, OperationKey, Subject) instead.RemoteContentRestrictionServiceContentRestriction for operationKey and subject to the content identified by contentId parameter.
Throws subclasses of ServiceException in case of various problems (cannot find content, wrong operationKey, restricting self, etc...)addDirectRestrictionForSubject in interface RemoteContentRestrictionServicecontentId - the id of the content which the restriction to be added tooperationKey - the operation to remove restriction forsubject - either User or Group who's restriction is to be addedServiceExceptionpublic CompletionStage<Void> addDirectRestrictionForSubjectCompletionStage(ContentId contentId, OperationKey operationKey, Subject subject) throws ServiceException
RemoteContentRestrictionServiceContentRestriction for operationKey and subject to the content identified by contentId parameter.
Throws subclasses of ServiceException in case of various problems (cannot find content, wrong operationKey, restricting self, etc...)addDirectRestrictionForSubjectCompletionStage in interface RemoteContentRestrictionServicecontentId - the id of the content which the restriction to be added tooperationKey - the operation to remove restriction forsubject - either User or Group who's restriction is to be addedServiceExceptionCopyright © 2003–2021 Atlassian. All rights reserved.