public class PermissionsResource extends Object
|Constructor and Description|
|Modifier and Type||Method and Description|
Returns all permissions that are present in the JIRA instance - Global, Project and the global ones added by plugins
Returns all permissions in the system and whether the currently logged in user has them.
public PermissionsResource(PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext, GlobalPermissionManager globalPermissionManager, ProjectManager projectManager, IssueManager issueManager, ResponseFactory responseFactory, FeatureManager featureManager)
public javax.ws.rs.core.Response getAllPermissions()
public javax.ws.rs.core.Response getPermissions(String projectKey, String projectId, String issueKey, String issueId)
NB: The above means that for issue-level permissions (EDIT_ISSUE for example), hasPermission may be true when no context is provided, or when a project context is provided, but may be false for any given (or all) issues. This would occur (for example) if Reporters were given the EDIT_ISSUE permission. This is because any user could be a reporter, except in the context of a concrete issue, where the reporter is known.
Global permissions will still be returned for all scopes.
Prior to version 6.4 this service returned project permissions with keys corresponding to com.atlassian.jira.security.Permissions.Permission constants. Since 6.4 those keys are considered deprecated and this service returns system project permission keys corresponding to constants defined in com.atlassian.jira.permission.ProjectPermissions. Permissions with legacy keys are still also returned for backwards compatibility, they are marked with an attribute deprecatedKey=true. The attribute is missing for project permissions with the current keys.
For Jira 8.5.x starting 8.5.12 it is possible to disable access to this endpoint for anonymous users. Enabling feature flag `jira.restrict.anonymous.access.to.mypermissions.rest.api.enabled` will restrict access to the endpoint for anonymous users. Endpoint will return response code 401 Unauthorized in such case
For Jira 8.8.0 and later anonymous access to the endpoint is removed.
projectKey- - key of project to scope returned permissions for.
projectId- - id of project to scope returned permissions for.
issueKey- - key of the issue to scope returned permissions for.
issueId- - id of the issue to scope returned permissions for.
Copyright © 2002-2021 Atlassian. All Rights Reserved.