Class DefaultAuthorizationSupport
- All Implemented Interfaces:
AuthorizationSupport
AuthorizationSupport
- Since:
- v4.3
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAuthorizationSupport
(GlobalPermissionManager globalPermissionManager, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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.
-
Constructor Details
-
DefaultAuthorizationSupport
public DefaultAuthorizationSupport(GlobalPermissionManager globalPermissionManager, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext)
-
-
Method Details
-
hasPermission
public boolean hasPermission(int permissionsId) Description copied from interface:AuthorizationSupport
Returns true if the logged in user has the given permission type.- Specified by:
hasPermission
in interfaceAuthorizationSupport
- Parameters:
permissionsId
- the permission type- Returns:
- true if the logged in user has the given permission type.
-
hasGlobalPermission
Description copied from interface:AuthorizationSupport
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
AuthorizationSupport.hasGlobalPermission(String)
instead.- Specified by:
hasGlobalPermission
in interfaceAuthorizationSupport
- Parameters:
globalPermissionKey
- the permission to check- Returns:
- true if the logged in user has the given global permission.
- See Also:
-
hasGlobalPermission
Description copied from interface:AuthorizationSupport
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
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.- Specified by:
hasGlobalPermission
in interfaceAuthorizationSupport
- Parameters:
permissionKey
- the permission to check- Returns:
- true if the logged in user has the given global permission.
- See Also:
-
hasIssuePermission
Description copied from interface:AuthorizationSupport
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.- Specified by:
hasIssuePermission
in interfaceAuthorizationSupport
- Parameters:
permissionKey
- the permission key as a Stringissue
- the Issue- Returns:
- true if the logged in user has the given permission type on the given Issue.
- See Also:
-
hasIssuePermission
Description copied from interface:AuthorizationSupport
Returns true if the logged in user has the given permission type on the given Issue.- Specified by:
hasIssuePermission
in interfaceAuthorizationSupport
- Parameters:
permissionsId
- the permission typeissue
- the Issue- Returns:
- true if the logged in user has the given permission type on the given Issue.
-
hasIssuePermission
Description copied from interface:AuthorizationSupport
Returns true if the logged in user has the given permission on the given Issue.- Specified by:
hasIssuePermission
in interfaceAuthorizationSupport
- Parameters:
projectPermissionKey
- the permission to checkissue
- the Issue- Returns:
- true if the logged in user has the given permission on the given Issue.
- See Also:
-
hasProjectPermission
Description copied from interface:AuthorizationSupport
Returns true if the logged in user has the given permission type on the given Project.- Specified by:
hasProjectPermission
in interfaceAuthorizationSupport
- Parameters:
permissionsId
- the permission typeproject
- the Project- Returns:
- true if the logged in user has the given permission type on the given Project.
-
hasProjectPermission
Description copied from interface:AuthorizationSupport
Returns true if the logged in user has the given permission on the given project.- Specified by:
hasProjectPermission
in interfaceAuthorizationSupport
- Parameters:
projectPermissionKey
- the permission to checkproject
- the project- Returns:
- true if the logged in user has the given permission on the given Issue.
-