Interface PermissionService
- All Known Implementing Classes:
PermissionServiceImpl
public interface PermissionService
Provides permission check methods used through GreenHopper
- Author:
- miruflin
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreateIssue
(com.atlassian.jira.user.ApplicationUser user) Check if the user is allowed to create an issue in any of the projects in the systemboolean
canCreateProject
(com.atlassian.jira.user.ApplicationUser user) Check if the user is allowed to create a project in the systemboolean
canUpdateIssue
(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.issue.Issue issue) Check if the user is allowed to save changes to the issue.boolean
canUpdateLinks
(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.issue.Issue issue) Checks if the user is allowed to modify this issue linksCollection<com.atlassian.jira.project.Project>
createIssueProjects
(com.atlassian.jira.user.ApplicationUser user) Get a collection of projects the user can create issues in.boolean
hasAllPermission
(com.atlassian.jira.user.ApplicationUser user, Collection<com.atlassian.jira.project.Project> projects, int permission) Has the user a certain right for all of the projects.boolean
hasGlobalPermission
(com.atlassian.jira.user.ApplicationUser user, int permission) Deprecated.boolean
hasGlobalPermission
(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.permission.GlobalPermissionKey globalPermissionKey) Check if the user has global permissionboolean
hasPermission
(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.issue.Issue issue, int permission) Has the user a certain right for a given issueboolean
hasPermission
(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.project.Project project, int permission) Has the user a certain right for a given project.boolean
hasSomePermission
(com.atlassian.jira.user.ApplicationUser user, Collection<com.atlassian.jira.project.Project> projects, int permission) Has the user a certain right for at least one of the projects.boolean
isAllProjectsAdministrator
(com.atlassian.jira.user.ApplicationUser user) Is the user a project admin for all projectsboolean
isJiraAdministrator
(com.atlassian.jira.user.ApplicationUser user) Check if the user is having Admin permission on the JIRA instanceboolean
isJiraSystemAdministrator
(com.atlassian.jira.user.ApplicationUser user) Check if the user is having System Administrator permission on the JIRA instanceboolean
isProjectAdministrator
(com.atlassian.jira.user.ApplicationUser user, Collection<com.atlassian.jira.project.Project> projects) Check if the user is having the project administrator role for all given projects
-
Field Details
-
SERVICE
Service identifier to be used for dependency injection.- See Also:
-
-
Method Details
-
hasPermission
boolean hasPermission(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.issue.Issue issue, int permission) Has the user a certain right for a given issue -
hasPermission
boolean hasPermission(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.project.Project project, int permission) Has the user a certain right for a given project.- Returns:
- true if the user has the requested right.
-
hasSomePermission
boolean hasSomePermission(com.atlassian.jira.user.ApplicationUser user, Collection<com.atlassian.jira.project.Project> projects, int permission) Has the user a certain right for at least one of the projects.- Returns:
- true if the user has the requested right. false if projects is empty
-
hasAllPermission
boolean hasAllPermission(com.atlassian.jira.user.ApplicationUser user, Collection<com.atlassian.jira.project.Project> projects, int permission) Has the user a certain right for all of the projects.- Returns:
- true if the user has the requested right. false if projects is empty
-
hasGlobalPermission
@Deprecated boolean hasGlobalPermission(com.atlassian.jira.user.ApplicationUser user, int permission) Deprecated.Has the user a global permission- Returns:
- true if the user has the requested global permission
-
hasGlobalPermission
boolean hasGlobalPermission(@Nullable com.atlassian.jira.user.ApplicationUser user, @Nonnull com.atlassian.jira.permission.GlobalPermissionKey globalPermissionKey) Check if the user has global permission- Parameters:
globalPermissionKey
- global permission, must not be nulluser
- The user - can be null indicating "anonymous"- Returns:
- true if the given user has the permission of given type, otherwise false.
-
isProjectAdministrator
boolean isProjectAdministrator(com.atlassian.jira.user.ApplicationUser user, Collection<com.atlassian.jira.project.Project> projects) Check if the user is having the project administrator role for all given projects -
isAllProjectsAdministrator
boolean isAllProjectsAdministrator(com.atlassian.jira.user.ApplicationUser user) Is the user a project admin for all projects -
isJiraAdministrator
boolean isJiraAdministrator(com.atlassian.jira.user.ApplicationUser user) Check if the user is having Admin permission on the JIRA instance -
isJiraSystemAdministrator
boolean isJiraSystemAdministrator(com.atlassian.jira.user.ApplicationUser user) Check if the user is having System Administrator permission on the JIRA instance -
canUpdateIssue
boolean canUpdateIssue(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.issue.Issue issue) Check if the user is allowed to save changes to the issue. Only checks for permissions, and not if the issue is editable from a workflow perspective. -
canUpdateLinks
boolean canUpdateLinks(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.issue.Issue issue) Checks if the user is allowed to modify this issue links -
canCreateIssue
boolean canCreateIssue(com.atlassian.jira.user.ApplicationUser user) Check if the user is allowed to create an issue in any of the projects in the system -
canCreateProject
boolean canCreateProject(com.atlassian.jira.user.ApplicationUser user) Check if the user is allowed to create a project in the system -
createIssueProjects
Collection<com.atlassian.jira.project.Project> createIssueProjects(com.atlassian.jira.user.ApplicationUser user) Get a collection of projects the user can create issues in.
-
hasGlobalPermission(ApplicationUser, GlobalPermissionKey)
instead