public interface

AuthorizationSupport

com.atlassian.jira.web.util.AuthorizationSupport
Known Indirect Subclasses

Class Overview

Groups a collection of authorization checks used by JIRA's view layer.

Summary

Public Methods
boolean hasGlobalPermission(String permissionKey)
Returns true if the logged in user has the given global permission.
boolean hasGlobalPermission(GlobalPermissionKey globalPermissionKey)
Returns true if the logged in user has the given global permission.
boolean hasIssuePermission(ProjectPermissionKey projectPermissionKey, Issue issue)
Returns true if the logged in user has the given permission on the given Issue.
boolean hasIssuePermission(int permissionsId, Issue issue)
boolean hasIssuePermission(String permissionKey, Issue issue)
Returns true if the logged in user has the given permission type on the given Issue.
boolean hasPermission(int permissionsId)
This method is deprecated. Use hasGlobalPermission(com.atlassian.jira.permission.GlobalPermissionKey) instead. Since v6.4.
boolean hasProjectPermission(int permissionsId, Project project)
boolean hasProjectPermission(ProjectPermissionKey projectPermissionKey, Project project)
Returns true if the logged in user has the given permission on the given project.

Public Methods

public boolean hasGlobalPermission (String permissionKey)

Returns true if the logged in user has the given global permission.

This method is intended to be used in JSP / Velocity / Soy Templates. If you are using Java directly, it is recommended to call hasGlobalPermission(com.atlassian.jira.permission.GlobalPermissionKey) instead.

Note that this method takes a Global Permission Key, which is a different value to the old "permission name" that some previous methods would accept - see GlobalPermissionKey for correct values of the system permissions.

Parameters
permissionKey the permission to check
Returns
  • true if the logged in user has the given global permission.

public boolean hasGlobalPermission (GlobalPermissionKey globalPermissionKey)

Returns true if the logged in user has the given global permission.

This method is intended to be used in Java code. If you are using JSP / Velocity / Soy Templates, it is probably easier to call hasGlobalPermission(String) instead.

Parameters
globalPermissionKey the permission to check
Returns
  • true if the logged in user has the given global permission.

public boolean hasIssuePermission (ProjectPermissionKey projectPermissionKey, Issue issue)

Returns true if the logged in user has the given permission on the given Issue.

Parameters
projectPermissionKey the permission to check
issue the Issue
Returns
  • true if the logged in user has the given permission on the given Issue.

public boolean hasIssuePermission (int permissionsId, Issue issue)

This method is deprecated.
Use hasIssuePermission(com.atlassian.jira.security.plugin.ProjectPermissionKey, com.atlassian.jira.issue.Issue) instead. Since v6.4.

Returns true if the logged in user has the given permission type on the given Issue.

Parameters
permissionsId the permission type
issue the Issue
Returns
  • true if the logged in user has the given permission type on the given Issue.

public boolean hasIssuePermission (String permissionKey, Issue issue)

Returns true if the logged in user has the given permission type on the given Issue.

This method is intended for use in Velocity templates / JSPs etc. Within Java code you should prefer the method that takes a ProjectPermissionKey.

Note that this method takes a Permission Key, which is a different value to the old "permission name" that some previous methods would accept - see ProjectPermissions for correct values of the system permissions.

Parameters
permissionKey the permission key as a String
issue the Issue
Returns
  • true if the logged in user has the given permission type on the given Issue.

public boolean hasPermission (int permissionsId)

This method is deprecated.
Use hasGlobalPermission(com.atlassian.jira.permission.GlobalPermissionKey) instead. Since v6.4.

Returns true if the logged in user has the given permission type.

Parameters
permissionsId the permission type
Returns
  • true if the logged in user has the given permission type.

public boolean hasProjectPermission (int permissionsId, Project project)

This method is deprecated.
Use hasProjectPermission(com.atlassian.jira.security.plugin.ProjectPermissionKey, com.atlassian.jira.project.Project) instead. Since v6.4.

Returns true if the logged in user has the given permission type on the given Project.

Parameters
permissionsId the permission type
project the Project
Returns
  • true if the logged in user has the given permission type on the given Project.

public boolean hasProjectPermission (ProjectPermissionKey projectPermissionKey, Project project)

Returns true if the logged in user has the given permission on the given project.

Parameters
projectPermissionKey the permission to check
project the project
Returns
  • true if the logged in user has the given permission on the given Issue.