public final class PermissionSchemeResource extends Object
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):
There are also two "hidden" holder types, which are not available in on-demand but can be used in enterprise instances:
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.
Modifier and Type | Field and Description |
---|---|
static String |
ENTITY_PATH |
static String |
RESOURCE_PATH |
Constructor and Description |
---|
PermissionSchemeResource(JiraAuthenticationContext authenticationContext,
PermissionSchemeBeansFactory beansFactory,
PermissionGrantBeanExpander permissionGrantBeanExpander,
PermissionSchemeService permissionSchemeService,
I18nHelper i18n,
ResponseFactory responseFactory,
GlobalPermissionManager globalPermissionManager) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
asAdmin(com.atlassian.jira.rest.v2.admin.permissionscheme.PermissionSchemeResource.RestAction action) |
javax.ws.rs.core.Response |
createPermissionGrant(Long schemeId,
PermissionGrantBean grantBean,
String expand)
Creates a permission grant in a permission scheme.
|
javax.ws.rs.core.Response |
createPermissionScheme(PermissionSchemeBean permissionScheme,
String expand)
Create a new permission scheme.
|
javax.ws.rs.core.Response |
deletePermissionScheme(Long id)
Deletes a permission scheme identified by the given id.
|
javax.ws.rs.core.Response |
deletePermissionSchemeEntity(Long schemeId,
Long permissionId)
Deletes a permission grant from a permission scheme.
|
javax.ws.rs.core.Response |
getPermissionScheme(Long id,
String expand)
Returns a permission scheme identified by the given id.
|
javax.ws.rs.core.Response |
getPermissionSchemeGrant(Long schemeId,
Long permissionId,
String expand)
Returns a permission grant identified by the given id.
|
javax.ws.rs.core.Response |
getPermissionSchemeGrants(Long schemeId,
String expand)
Returns all permission grants of the given permission scheme.
|
javax.ws.rs.core.Response |
getPermissionSchemes(String expand)
Returns a list of all permission schemes.
|
javax.ws.rs.core.Response |
updatePermissionScheme(Long schemeId,
PermissionSchemeBean permissionScheme,
String expand)
Updates a permission scheme.
|
public static final String RESOURCE_PATH
public static final String ENTITY_PATH
public PermissionSchemeResource(JiraAuthenticationContext authenticationContext, PermissionSchemeBeansFactory beansFactory, PermissionGrantBeanExpander permissionGrantBeanExpander, PermissionSchemeService permissionSchemeService, I18nHelper i18n, ResponseFactory responseFactory, GlobalPermissionManager globalPermissionManager)
public javax.ws.rs.core.Response getPermissionSchemes(String expand)
By default only shortened beans are returned. If you want to include permissions of all the schemes, then specify the permissions expand parameter. Permissions will be included also if you specify any other expand parameter.
public javax.ws.rs.core.Response getPermissionScheme(Long id, String expand)
public javax.ws.rs.core.Response deletePermissionScheme(Long id)
public javax.ws.rs.core.Response createPermissionScheme(PermissionSchemeBean permissionScheme, String expand)
public javax.ws.rs.core.Response updatePermissionScheme(Long schemeId, PermissionSchemeBean permissionScheme, String expand)
If the permissions list is present then it will be set in the permission scheme, which basically means it will overwrite any permission grants that existed in the permission scheme. Sending an empty list will remove all permission grants from the permission scheme.
To update just the name and description, do not send permissions list at all.
To add or remove a single permission grant instead of updating the whole list at once use the {schemeId}/permission/ resource.
public javax.ws.rs.core.Response getPermissionSchemeGrants(Long schemeId, String expand)
public javax.ws.rs.core.Response createPermissionGrant(Long schemeId, PermissionGrantBean grantBean, String expand)
public javax.ws.rs.core.Response deletePermissionSchemeEntity(Long schemeId, Long permissionId)
public javax.ws.rs.core.Response getPermissionSchemeGrant(Long schemeId, Long permissionId, String expand)
public javax.ws.rs.core.Response asAdmin(com.atlassian.jira.rest.v2.admin.permissionscheme.PermissionSchemeResource.RestAction action)
Copyright © 2002-2015 Atlassian. All Rights Reserved.