@ParametersAreNonnullByDefault @PublicApi public interface PermissionSchemeService
Modifier and Type | Method and Description |
---|---|
ServiceResult |
assignPermissionSchemeToProject(ApplicationUser user,
Long schemeId,
Long projectId)
Sets the specified permission scheme in the given project.
|
ServiceOutcome<PermissionScheme> |
createPermissionScheme(ApplicationUser user,
PermissionSchemeInput permissionScheme)
Creates a new permission scheme.
|
ServiceResult |
deletePermissionScheme(ApplicationUser user,
Long id)
Deletes a permission scheme.
|
ServiceOutcome<PermissionScheme> |
getPermissionScheme(ApplicationUser user,
Long id)
Returns a permission scheme with the specified id.
|
ServiceOutcome<? extends List<PermissionScheme>> |
getPermissionSchemes(ApplicationUser user)
Returns all permission schemes sorted alphabetically by name.
|
ServiceOutcome<PermissionScheme> |
getSchemeAssignedToProject(ApplicationUser user,
Long projectId)
Returns a permission scheme assigned to the specified project.
|
ServiceOutcome<PermissionScheme> |
updatePermissionScheme(ApplicationUser user,
Long id,
PermissionSchemeInput permissionScheme)
Updates a permission scheme identified by the given id.
|
ServiceOutcome<? extends List<PermissionScheme>> getPermissionSchemes(@Nullable ApplicationUser user)
Only schemes the user has access to will be returned. That means all the schemes if the user is a JIRA administrator, or the schemes assigned to projects the user administers.
user
- user that performs the operationServiceOutcome<PermissionScheme> getPermissionScheme(@Nullable ApplicationUser user, Long id)
The user needs to have access to the permission scheme. That means the user needs to be a JIRA administrator or administer a project which has the scheme assigned.
user
- user that performs the operationid
- identifier of the permission schemeServiceOutcome<PermissionScheme> createPermissionScheme(@Nullable ApplicationUser user, PermissionSchemeInput permissionScheme)
The permission scheme is validated thoroughly, e.g. if there is a permission for a group, then the group must exist, ditto for project roles, users, custom fields etc. Custom fields must be of proper types.
Note that permission scheme names must be unique.
user
- user that performs the operation. The user needs to be a JIRA administrator.permissionScheme
- permission scheme to createServiceOutcome<PermissionScheme> updatePermissionScheme(@Nullable ApplicationUser user, Long id, PermissionSchemeInput permissionScheme)
Validation is the same as in the createPermissionScheme(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.permission.PermissionSchemeInput)
method.
user
- user that performs the operation. The user needs to be a JIRA administrator.id
- id of the scheme to be updatedpermissionScheme
- new data of the permission schemeServiceResult deletePermissionScheme(@Nullable ApplicationUser user, Long id)
user
- user that performs the operation. The user needs to be a JIRA administrator.id
- identifier of the permission scheme to be deletedServiceResult assignPermissionSchemeToProject(@Nullable ApplicationUser user, Long schemeId, Long projectId)
user
- user that performs the operation. The user needs to be a JIRA administrator.schemeId
- scheme to assign to the projectprojectId
- project to assign the scheme toServiceOutcome<PermissionScheme> getSchemeAssignedToProject(@Nullable ApplicationUser user, Long projectId)
If there is no scheme explicitly assigned, the default scheme is returned.
user
- user that performs the operation. The user needs a permission to administer the project.projectId
- identifier of the projectCopyright © 2002-2019 Atlassian. All Rights Reserved.