public class DefaultAuthorizationSupport extends Object implements AuthorizationSupport
AuthorizationSupport
Constructor and Description |
---|
DefaultAuthorizationSupport(GlobalPermissionManager globalPermissionManager,
PermissionManager permissionManager,
JiraAuthenticationContext jiraAuthenticationContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasGlobalPermission(GlobalPermissionKey globalPermissionKey)
Returns true if the logged in user has the given global permission.
|
boolean |
hasGlobalPermission(String permissionKey)
Returns true if the logged in user has the given global permission.
|
boolean |
hasIssuePermission(int permissionsId,
Issue issue)
Returns true if the logged in user has the given permission type on the given Issue.
|
boolean |
hasIssuePermission(ProjectPermissionKey projectPermissionKey,
Issue issue)
Returns true if the logged in user has the given permission on the given 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)
Returns true if the logged in user has the given permission type.
|
boolean |
hasProjectPermission(int permissionsId,
Project project)
Returns true if the logged in user has the given permission type on the given Project.
|
boolean |
hasProjectPermission(ProjectPermissionKey projectPermissionKey,
Project project)
Returns true if the logged in user has the given permission on the given project.
|
public DefaultAuthorizationSupport(GlobalPermissionManager globalPermissionManager, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext)
public boolean hasPermission(int permissionsId)
AuthorizationSupport
hasPermission
in interface AuthorizationSupport
permissionsId
- the permission typepublic boolean hasGlobalPermission(GlobalPermissionKey globalPermissionKey)
AuthorizationSupport
This method is intended to be used in Java code. If you are using JSP / Velocity / Soy Templates, it is
probably easier to call AuthorizationSupport.hasGlobalPermission(String)
instead.
hasGlobalPermission
in interface AuthorizationSupport
globalPermissionKey
- the permission to checkAuthorizationSupport.hasGlobalPermission(String)
public boolean hasGlobalPermission(String permissionKey)
AuthorizationSupport
This method is intended to be used in JSP / Velocity / Soy Templates. If you are using Java directly, it is
recommended to call AuthorizationSupport.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.
hasGlobalPermission
in interface AuthorizationSupport
permissionKey
- the permission to checkAuthorizationSupport.hasGlobalPermission(com.atlassian.jira.permission.GlobalPermissionKey)
public boolean hasIssuePermission(String permissionKey, Issue issue)
AuthorizationSupport
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.
hasIssuePermission
in interface AuthorizationSupport
permissionKey
- the permission key as a Stringissue
- the IssueAuthorizationSupport.hasIssuePermission(com.atlassian.jira.security.plugin.ProjectPermissionKey, com.atlassian.jira.issue.Issue)
public boolean hasIssuePermission(int permissionsId, Issue issue)
AuthorizationSupport
hasIssuePermission
in interface AuthorizationSupport
permissionsId
- the permission typeissue
- the Issuepublic boolean hasIssuePermission(ProjectPermissionKey projectPermissionKey, Issue issue)
AuthorizationSupport
hasIssuePermission
in interface AuthorizationSupport
projectPermissionKey
- the permission to checkissue
- the IssueAuthorizationSupport.hasIssuePermission(String, com.atlassian.jira.issue.Issue)
public boolean hasProjectPermission(int permissionsId, Project project)
AuthorizationSupport
hasProjectPermission
in interface AuthorizationSupport
permissionsId
- the permission typeproject
- the Projectpublic boolean hasProjectPermission(ProjectPermissionKey projectPermissionKey, Project project)
AuthorizationSupport
hasProjectPermission
in interface AuthorizationSupport
projectPermissionKey
- the permission to checkproject
- the projectCopyright © 2002-2021 Atlassian. All Rights Reserved.