Class SpacePermissionResource

java.lang.Object
com.atlassian.confluence.plugins.restapi.resources.SpacePermissionResource

@Consumes("application/json") @Produces("application/json") @Path("/space/{spaceKey}/permissions") public class SpacePermissionResource extends Object
REST API for adding and removing a space permission.
Since:
9.1.0
  • Constructor Details

    • SpacePermissionResource

      @Inject public SpacePermissionResource(SpacePermissionService spacePermissionService)
  • Method Details

    • getAllSpacePermissions

      @GET public javax.ws.rs.core.Response getAllSpacePermissions(@PathParam("spaceKey") String spaceKey)

      Get all space permissions

      Parameters:
      spaceKey - the key of the space
      Returns:
      all permissions granted to users and groups in the particular space
    • getPermissionsGrantedToUser

      @GET @Path("/user/{userKey}") public javax.ws.rs.core.Response getPermissionsGrantedToUser(@PathParam("spaceKey") String spaceKey, @PathParam("userKey") String userKey)

      Gets the permissions granted to a user in a space.

      Parameters:
      spaceKey - the key of the space
      userKey - the key of the user to look up
    • getPermissionsGrantedToAnonymousUsers

      @GET @Path("/anonymous") public javax.ws.rs.core.Response getPermissionsGrantedToAnonymousUsers(@PathParam("spaceKey") String spaceKey)

      Get the permissions granted to an anonymous users in the given space.

      Parameters:
      spaceKey - the key of the space
    • getPermissionsGrantedToGroup

      @GET @Path("/group/{groupName}") public javax.ws.rs.core.Response getPermissionsGrantedToGroup(@PathParam("spaceKey") String spaceKey, @PathParam("groupName") String groupName)
    • grantPermissionsToUser

      @PUT @Path("user/{userKey}/grant") public javax.ws.rs.core.Response grantPermissionsToUser(@PathParam("spaceKey") String spaceKey, @PathParam("userKey") String userKey, Set<OperationDescription> permissions)

      Grant permissions to a user in the given space.

      Parameters:
      spaceKey - the key of the space to update
      userKey - the key of the user to look up
      permissions - the permissions being added
    • grantPermissionsToAnonymousUsers

      @PUT @Path("anonymous/grant") public javax.ws.rs.core.Response grantPermissionsToAnonymousUsers(@PathParam("spaceKey") String spaceKey, Set<OperationDescription> permissions)

      Grant permissions to anonymous user in the given space.

      Parameters:
      spaceKey - the key of the space to update
      permissions - the permissions being added
    • grantPermissionsToGroup

      @PUT @Path("group/{groupName}/grant") public javax.ws.rs.core.Response grantPermissionsToGroup(@PathParam("spaceKey") String spaceKey, @PathParam("groupName") String groupName, Set<OperationDescription> permissions)

      Grant permissions to a group in the given space.

      Parameters:
      spaceKey - the key of the space to update
      permissions - the permissions being added
    • revokePermissionsFromUser

      @PUT @Path("user/{userKey}/revoke") public javax.ws.rs.core.Response revokePermissionsFromUser(@PathParam("spaceKey") String spaceKey, @PathParam("userKey") String userKey, Set<OperationDescription> permissions)

      Revoke permissions from a user in the given space.

      Parameters:
      spaceKey - the key of the space to update
      permissions - the permissions being added
    • revokePermissionsFromAnonymousUser

      @PUT @Path("anonymous/revoke") public javax.ws.rs.core.Response revokePermissionsFromAnonymousUser(@PathParam("spaceKey") String spaceKey, Set<OperationDescription> permissions)

      Revoke permissions from a user in the given space.

      Parameters:
      spaceKey - the key of the space to update
      permissions - the permissions being added
    • revokePermissionsFromGroup

      @PUT @Path("group/{groupName}/revoke") public javax.ws.rs.core.Response revokePermissionsFromGroup(@PathParam("spaceKey") String spaceKey, @PathParam("groupName") String groupName, Set<OperationDescription> permissions)

      Revoke permissions from a group in the given space.

      Parameters:
      spaceKey - the key of the space to update
      permissions - the permissions being added
    • setPermissions

      @POST public javax.ws.rs.core.Response setPermissions(@PathParam("spaceKey") String spaceKey, Set<SpacePermissionsForSubject> spacePermissionsForSubjects)

      Sets permissions to multiple users/groups in the given space. Request should contain all permissions that user/group will have in a given space. If permission is absent in the request, but was granted before, it will be revoked.

      Parameters:
      spaceKey - the key of the space to update
      spacePermissionsForSubjects - the permissions being added to multiple users/groups