public class ExperimentalContentRestrictionsResource extends Object
Constructor and Description |
---|
ExperimentalContentRestrictionsResource(ContentRestrictionService service) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addIndividualGroupRestriction(ContentId contentId,
OperationKey operationKey,
Group group)
Adds singular direct
ContentRestriction for operationKey and group for the content identified by contentId parameter. |
javax.ws.rs.core.Response |
addIndividualUserRestriction(ContentId contentId,
OperationKey operationKey,
com.atlassian.sal.api.user.UserKey userKey,
String userName)
Adds singular direct
ContentRestriction for operationKey and user for the content identified by contentId parameter. |
PageResponse<ContentRestriction> |
addRestrictions(ContentId contentId,
String expand,
PageResponse<ContentRestriction> contentRestrictions)
Adds all the restrictions specified to a piece of content identified by
contentId . |
javax.ws.rs.core.Response |
deleteIndividualGroupRestriction(ContentId contentId,
OperationKey operationKey,
Group group)
Deletes singular direct
ContentRestriction for operationKey and user from the content identified by contentId parameter. |
javax.ws.rs.core.Response |
deleteIndividualUserRestriction(ContentId contentId,
OperationKey operationKey,
com.atlassian.sal.api.user.UserKey userKey,
String userName)
Deletes singular direct
ContentRestriction for operationKey and user from the content identified by contentId parameter. |
PageResponse<ContentRestriction> |
deleteRestrictions(ContentId contentId,
String expand)
Removes all the restrictions specified directly on the content.
|
javax.ws.rs.core.Response |
getIndividualGroupRestrictionStatus(ContentId contentId,
OperationKey operationKey,
Group group)
Answers the question
"Whether group, identified by
groupName is a subject of the restriction for operation operationKey directly specified on a content with ID of ccontentId " |
javax.ws.rs.core.Response |
getIndividualUserRestrictionStatus(ContentId contentId,
OperationKey operationKey,
com.atlassian.sal.api.user.UserKey userKey,
String userName)
Answers the question
"Whether user, identified by
userKey is a subject of the restriction for operation operationKey directly specified on a content with ID of ccontentId " |
PageResponse<ContentRestriction> |
getRestrictions(ContentId contentId,
String expand,
javax.ws.rs.core.UriInfo uriInfo,
int start,
int limit)
Returns all the restrictions which are directly specified on a piece of content identified by
contentId
param |
PageResponse<ContentRestriction> |
updateRestrictions(ContentId contentId,
String expand,
PageResponse<ContentRestriction> contentRestrictions)
Sets all the restrictions specified to a piece of content identified by
contentId , replacing any existing permissions. |
public ExperimentalContentRestrictionsResource(ContentRestrictionService service)
public PageResponse<ContentRestriction> getRestrictions(ContentId contentId, String expand, @Context javax.ws.rs.core.UriInfo uriInfo, int start, int limit)
Returns all the restrictions which are directly specified on a piece of content identified by contentId
param
Example request URI:
http://example.com/confluence/rest/experimental/content/1234567/restriction?expand=
contentId
- content to get restrictions forexpand
- a coma separated list of properties to expand in the response. Default is restrictions.user,restrictions.group
uriInfo
- injected by Jerseystart
- the start point of the collection to returnlimit
- the limit of the number of items to return, this may be restricted by fixed system limitsPageResponse
with all the restrictions which are specified directly on a Contentpublic PageResponse<ContentRestriction> updateRestrictions(ContentId contentId, String expand, PageResponse<ContentRestriction> contentRestrictions)
contentId
, replacing any existing permissions.
Setting per-content restrictions is currently allowed for Pages or BlogPosts only.
Example request URI:
http://example.com/confluence/rest/experimental/content/1234567/restriction?expand=
Accepts same input format as the response of GET to the same resource would return.
For the sake of simplicity also allows stripping of {"results": ... }"
part and inlining arrays of specific users/groups directly.
E.g.
Example request (simplified)
[
{
"operation": "update",
"restrictions":
{
"user": [
{
"type": "known",
"username": "admin"
}
]
}
}
]
Rules of applying restrictions via this method:
ContentRestriction
s is allowed to have only 1 (ONE) ContentRestriction
object for each operation.contentId
- content to set restrictions forexpand
- a coma separated list of properties to expand in the response. Default is restrictions.user,restrictions.group
PageResponse
with all the restrictions which are specified directly on a Content. Result is the same as the response of GET to the same resource would return.public PageResponse<ContentRestriction> addRestrictions(ContentId contentId, String expand, PageResponse<ContentRestriction> contentRestrictions)
contentId
.
Does not replace/remove/alter any pre-existing ContentRestriction
s.
Provided ContentRestriction
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.
Example request URI:
http://example.com/confluence/rest/experimental/content/1234567/restriction?expand=
Accepts same input format as the response of GET to the same resource would return.
For the sake of simplicity also allows stripping of {"results": ... }"
part and inlining arrays of specific users/groups directly.
E.g.
Example request (simplified)
[
{
"operation": "update",
"restrictions":
{
"user": [
{
"type": "known",
"username": "admin"
}
]
}
}
]
Rules of applying restrictions via this method:
ContentRestriction
s is allowed to have only 1 (ONE) ContentRestriction
object for each operation.null
, or missing will result in not changing corresponding operation's user/group restrictions for the content.contentId
- the id of the content to add restrictions tocontentRestrictions
- Collection of ContentRestriction
s to add to the Content specifiedexpand
- the expansions to the ContentRestriction. To be expanded on response.PageResponse
with all the restrictions which are specified directly on a Content. Result is the same as the response of GET to the same resource would return.public PageResponse<ContentRestriction> deleteRestrictions(ContentId contentId, String expand)
User performing this operation must have enough rights to edit the content specified as well as restrictions associated with it in order to proceed.
contentId
- the id of the content to remove all restrictions fromexpand
- the expansions to the ContentRestriction. To be expanded on response.PageResponse
with all the restrictions which are specified directly on a Content. Result is the same as the response of GET to the same resource would return.public javax.ws.rs.core.Response getIndividualUserRestrictionStatus(ContentId contentId, OperationKey operationKey, com.atlassian.sal.api.user.UserKey userKey, String userName)
userKey
is a subject of the restriction for operation operationKey
directly specified on a content with ID of ccontentId
"
Content identified by the id must exist and be accessible by the user performing this operation.
contentId
- the id of the content to perform the test onoperationKey
- key for the Operation for which restrictions are to be checkeduserKey
- userKey identifying the user in questiontrue
if the user in question is listed as a subject in one of the ContentRestircions directly specified on the content, false
otherwisepublic javax.ws.rs.core.Response getIndividualGroupRestrictionStatus(ContentId contentId, OperationKey operationKey, Group group)
groupName
is a subject of the restriction for operation operationKey
directly specified on a content with ID of ccontentId
"
Content identified by the id must exist and be accessible by the user performing this operation.
contentId
- the id of the content to perform the test onoperationKey
- key for the Operation for which restrictions are to be checkedgroup
- group in question identified by the groupName
path parametertrue
if the group in question is listed as a subject in one of the ContentRestircions directly specified on the content, false
otherwisepublic javax.ws.rs.core.Response deleteIndividualUserRestriction(ContentId contentId, OperationKey operationKey, com.atlassian.sal.api.user.UserKey userKey, String userName)
ContentRestriction
for operationKey
and user
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...)
Content identified by the id must exist and be accessible by the user performing this operation. User performing this operation must have all the required permissions for that Restriction to be deleted must exist
contentId
- the id of the content which the restriction to be removed fromoperationKey
- the operation to remove restriction foruserKey
- userKey identifying the User
who's restriction is to be deleteduserName
- userName identifying the User
who's restriction is to be deletedHTTP.200
if the deletion was successfulpublic javax.ws.rs.core.Response deleteIndividualGroupRestriction(ContentId contentId, OperationKey operationKey, Group group)
ContentRestriction
for operationKey
and user
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...)
Content identified by the id must exist and be accessible by the user performing this operation. User performing this operation must have all the required permissions for that Restriction to be deleted must exist
contentId
- the id of the content which the restriction to be removed fromoperationKey
- the operation to remove restriction forgroup
- group (constructed from the groupName) identifying the Group
who's restriction is to be deletedHTTP.200
if the deletion was successfulpublic javax.ws.rs.core.Response addIndividualUserRestriction(ContentId contentId, OperationKey operationKey, com.atlassian.sal.api.user.UserKey userKey, String userName)
ContentRestriction
for operationKey
and user
for the content identified by contentId
parameter.
Throws subclasses of ServiceException
in case of various problems (cannot find content, wrong opkey, not enought permissions, etc...)
Content identified by the id must exist and be accessible by the user performing this operation. User performing this operation must have all the required permissions for that
contentId
- the id of the content which the restriction to be added tooperationKey
- the operation to add restriction foruserKey
- userKey identifying the User
who's restriction is to be addeduserName
- userName identifying the User
who's restriction is to be addedHTTP.200
if the addition was successfulpublic javax.ws.rs.core.Response addIndividualGroupRestriction(ContentId contentId, OperationKey operationKey, Group group)
ContentRestriction
for operationKey
and group
for the content identified by contentId
parameter.
Throws subclasses of ServiceException
in case of various problems (cannot find content, wrong opkey, not enought permissions, etc...)
Content identified by the id must exist and be accessible by the user performing this operation. User performing this operation must have all the required permissions for that
contentId
- the id of the content which the restriction to be added tooperationKey
- the operation to add restriction forgroup
- group (constructed from the groupName) identifying the Group
who's restriction is to be addedHTTP.200
if the addition was successfulCopyright © 2003–2016 Atlassian. All rights reserved.