Class PermissionSchemeResource

java.lang.Object
com.atlassian.jira.rest.v2.admin.permissionscheme.PermissionSchemeResource

@Path("permissionscheme") @Consumes("application/json") @Produces("application/json") public final class PermissionSchemeResource extends Object
Resource for managing permission schemes and their attributes.

Permission scheme is a collection of permission grants. Each grant holds information about a permission granted to a group of users. These groups of users are called holders and are defined by two values: type and parameter. Type can be for example "group", or "user" and parameter is an additional specification. In case of groups the parameter will hold the group name, and in case of users: user id.

Types can be extended by plugins, but here is a list of all built-in types (expected parameter contents are given in parenthesis):

anyone
Grant for anonymous users.
group (group name)
Grant for the specified group
user (user id)
Grant for the specified user
projectRole (project role id)
Grant for the specified project role
reporter
Grant for an issue reported
projectLead
Grant for a project lead
assignee
Grant for a user assigned to an issue
userCustomField (custom field id)
Grant for a user selected in the specified custom field
groupCustomField (custom field id)
Grant for a user selected in the specified custom field

There are also two "hidden" holder types, which are not available in on-demand but can be used in enterprise instances:

reporterWithCreatePermission
This type can be used only with BROWSE_PROJECTS permission to show only projects where the user has create permission and issues within that where they are the reporter.
assigneeWithAssignablePermission
This type can be used only with BROWSE_PROJECTS permission to show only projects where the user has the assignable permission and issues within that where they are the assignee.

In addition to specifying the permission holder, a permission must be selected. That way a pair of (holder, permission) is created and it represents a single permission grant.

Custom permissions can be added by plugins, but below we present a set of built-in Jira permissions.

  • ADMINISTER_PROJECTS
  • BROWSE_PROJECTS
  • VIEW_DEV_TOOLS
  • VIEW_READONLY_WORKFLOW
  • CREATE_ISSUES
  • EDIT_ISSUES
  • TRANSITION_ISSUES
  • SCHEDULE_ISSUES
  • MOVE_ISSUES
  • ASSIGN_ISSUES
  • ASSIGNABLE_USER
  • RESOLVE_ISSUES
  • CLOSE_ISSUES
  • MODIFY_REPORTER
  • DELETE_ISSUES
  • LINK_ISSUES
  • SET_ISSUE_SECURITY
  • VIEW_VOTERS_AND_WATCHERS
  • MANAGE_WATCHERS
  • ADD_COMMENTS
  • EDIT_ALL_COMMENTS
  • EDIT_OWN_COMMENTS
  • DELETE_ALL_COMMENTS
  • DELETE_OWN_COMMENTS
  • CREATE_ATTACHMENTS
  • DELETE_ALL_ATTACHMENTS
  • DELETE_OWN_ATTACHMENTS
  • WORK_ON_ISSUES
  • EDIT_OWN_WORKLOGS
  • EDIT_ALL_WORKLOGS
  • DELETE_OWN_WORKLOGS
  • DELETE_ALL_WORKLOGS

Since:
7.4 managing permission scheme attributes
  • Field Details

  • Constructor Details

  • Method Details

    • getPermissionSchemes

      @GET public jakarta.ws.rs.core.Response getPermissionSchemes(@QueryParam("expand") String expand)
      Returns a list of all permission schemes.
      Returns:
      a list of all permission schemes.
    • getPermissionScheme

      @GET @Path("{schemeId}") public jakarta.ws.rs.core.Response getPermissionScheme(@PathParam("schemeId") Long id, @QueryParam("expand") String expand)
      Returns a permission scheme identified by the given id.
      Returns:
      a permission scheme.
    • deletePermissionScheme

      @DELETE @Path("{schemeId}") public jakarta.ws.rs.core.Response deletePermissionScheme(@PathParam("schemeId") Long id)
      Deletes a permission scheme identified by the given id.
    • createPermissionScheme

      @POST public jakarta.ws.rs.core.Response createPermissionScheme(PermissionSchemeBean permissionScheme, @QueryParam("expand") String expand)
      Create a new permission scheme. This method can create schemes with a defined permission set, or without.
      Returns:
      a newly created scheme
    • updatePermissionScheme

      @PUT @Path("{schemeId}") public jakarta.ws.rs.core.Response updatePermissionScheme(@PathParam("schemeId") Long schemeId, PermissionSchemeBean permissionScheme, @QueryParam("expand") String expand)
      Updates a permission scheme.
      Returns:
      a newly updated scheme
    • getSchemeAttribute

      @GET @Path("{permissionSchemeId}/attribute/{attributeKey}") @ExperimentalApi public jakarta.ws.rs.core.Response getSchemeAttribute(@PathParam("permissionSchemeId") Long schemeId, @PathParam("attributeKey") String key)
      Parameters:
      schemeId - permission scheme id
      key - permission scheme attribute key
      Returns:
      the json representation of the attribute for given permission scheme id and attribute key
    • setSchemeAttribute

      @PUT @Path("{permissionSchemeId}/attribute/{key}") @Consumes("text/plain") @ExperimentalApi public jakarta.ws.rs.core.Response setSchemeAttribute(@PathParam("permissionSchemeId") Long schemeId, @PathParam("key") String key, String value)
      Updates or inserts the attribute for a permission scheme specified by permission scheme id. The attribute consists of the key and the value. The value will be converted to Boolean using Boolean#valueOf.
      Parameters:
      schemeId - permission scheme id
      key - permission scheme attribute key
      value - permission scheme attribute value passed as the request body
      Returns:
      no content response
    • getPermissionSchemeGrants

      @GET @Path("{schemeId}/permission") public jakarta.ws.rs.core.Response getPermissionSchemeGrants(@PathParam("schemeId") Long schemeId, @QueryParam("expand") String expand)
      Returns all permission grants of the given permission scheme.
      Returns:
      a permission scheme entities list.
    • createPermissionGrant

      @POST @Path("{schemeId}/permission") public jakarta.ws.rs.core.Response createPermissionGrant(@PathParam("schemeId") Long schemeId, PermissionGrantBean grantBean, @QueryParam("expand") String expand)
      Creates a permission grant in a permission scheme.
      Returns:
      a newly created permission
    • deletePermissionSchemeEntity

      @DELETE @Path("{schemeId}/permission/{permissionId}") public jakarta.ws.rs.core.Response deletePermissionSchemeEntity(@PathParam("schemeId") Long schemeId, @PathParam("permissionId") Long permissionId)
      Deletes a permission grant from a permission scheme.
      Returns:
      no content response
    • getPermissionSchemeGrant

      @GET @Path("{schemeId}/permission/{permissionId}") public jakarta.ws.rs.core.Response getPermissionSchemeGrant(@PathParam("schemeId") Long schemeId, @PathParam("permissionId") Long permissionId, @QueryParam("expand") String expand)
      Returns a permission grant identified by the given id.
      Returns:
      the permission grant
    • asAdmin

      public jakarta.ws.rs.core.Response asAdmin(com.atlassian.jira.rest.v2.admin.permissionscheme.PermissionSchemeResource.RestAction action)