com.atlassian.greenhopper.service
Class PermissionServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.PermissionServiceImpl
All Implemented Interfaces:
PermissionService

@Service(value="gh-permissionService")
public class PermissionServiceImpl
extends java.lang.Object
implements PermissionService

PermissionService implementation


Field Summary
 
Fields inherited from interface com.atlassian.greenhopper.service.PermissionService
SERVICE
 
Constructor Summary
PermissionServiceImpl()
           
 
Method Summary
 boolean canCreateIssue(com.atlassian.crowd.embedded.api.User user)
          Check if the user is allowed to create an issue in any of the projects in the system
 boolean canCreateProject(com.atlassian.crowd.embedded.api.User user)
          Check if the user is allowed to create a project in the system
 boolean canUpdateIssue(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.issue.Issue issue)
          Check if the user is allowed to save changes to the issue.
 boolean hasAllPermission(com.atlassian.crowd.embedded.api.User user, java.util.Collection<com.atlassian.jira.project.Project> projects, int permission)
          Has the user a certain right for all of the projects.
 boolean hasGlobalPermission(com.atlassian.crowd.embedded.api.User user, int permission)
          Has the user a global permission
 boolean hasPermission(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.issue.Issue issue, int permission)
          Has the user a certain right for a given issue
 boolean hasPermission(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.project.Project project, int permission)
          Has the user a certain right for a given project.
 boolean hasSomePermission(com.atlassian.crowd.embedded.api.User user, java.util.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.crowd.embedded.api.User user)
          Is the user a project admin for all projects
 boolean isJiraAdministrator(com.atlassian.crowd.embedded.api.User user)
          Check if the user is having Admin permission on the JIRA instance
 boolean isJiraSystemAdministrator(com.atlassian.crowd.embedded.api.User user)
          Check if the user is having System Administrator permission on the JIRA instance
 boolean isProjectAdministrator(com.atlassian.crowd.embedded.api.User user, java.util.Collection<com.atlassian.jira.project.Project> projects)
          Check if the user is having the project administrator role for all given projects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionServiceImpl

public PermissionServiceImpl()
Method Detail

hasPermission

public boolean hasPermission(com.atlassian.crowd.embedded.api.User user,
                             com.atlassian.jira.issue.Issue issue,
                             int permission)
Description copied from interface: PermissionService
Has the user a certain right for a given issue

Specified by:
hasPermission in interface PermissionService

hasPermission

public boolean hasPermission(com.atlassian.crowd.embedded.api.User user,
                             com.atlassian.jira.project.Project project,
                             int permission)
Description copied from interface: PermissionService
Has the user a certain right for a given project.

Specified by:
hasPermission in interface PermissionService
Returns:
true if the user has the requested right.

hasSomePermission

public boolean hasSomePermission(com.atlassian.crowd.embedded.api.User user,
                                 java.util.Collection<com.atlassian.jira.project.Project> projects,
                                 int permission)
Description copied from interface: PermissionService
Has the user a certain right for at least one of the projects.

Specified by:
hasSomePermission in interface PermissionService
Returns:
true if the user has the requested right. false if projects is empty

hasAllPermission

public boolean hasAllPermission(com.atlassian.crowd.embedded.api.User user,
                                java.util.Collection<com.atlassian.jira.project.Project> projects,
                                int permission)
Description copied from interface: PermissionService
Has the user a certain right for all of the projects.

Specified by:
hasAllPermission in interface PermissionService
Returns:
true if the user has the requested right. false if projects is empty

hasGlobalPermission

public boolean hasGlobalPermission(com.atlassian.crowd.embedded.api.User user,
                                   int permission)
Description copied from interface: PermissionService
Has the user a global permission

Specified by:
hasGlobalPermission in interface PermissionService
Returns:
true if the user has the requested global permission

isProjectAdministrator

public boolean isProjectAdministrator(com.atlassian.crowd.embedded.api.User user,
                                      java.util.Collection<com.atlassian.jira.project.Project> projects)
Description copied from interface: PermissionService
Check if the user is having the project administrator role for all given projects

Specified by:
isProjectAdministrator in interface PermissionService

isAllProjectsAdministrator

public boolean isAllProjectsAdministrator(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: PermissionService
Is the user a project admin for all projects

Specified by:
isAllProjectsAdministrator in interface PermissionService

isJiraAdministrator

public boolean isJiraAdministrator(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: PermissionService
Check if the user is having Admin permission on the JIRA instance

Specified by:
isJiraAdministrator in interface PermissionService

isJiraSystemAdministrator

public boolean isJiraSystemAdministrator(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: PermissionService
Check if the user is having System Administrator permission on the JIRA instance

Specified by:
isJiraSystemAdministrator in interface PermissionService

canUpdateIssue

public boolean canUpdateIssue(com.atlassian.crowd.embedded.api.User user,
                              com.atlassian.jira.issue.Issue issue)
Description copied from interface: PermissionService
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.

Specified by:
canUpdateIssue in interface PermissionService

canCreateIssue

public boolean canCreateIssue(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: PermissionService
Check if the user is allowed to create an issue in any of the projects in the system

Specified by:
canCreateIssue in interface PermissionService

canCreateProject

public boolean canCreateProject(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: PermissionService
Check if the user is allowed to create a project in the system

Specified by:
canCreateProject in interface PermissionService


Copyright © 2007-2013 Atlassian. All Rights Reserved.