Class DefaultAuthorizationSupport
- All Implemented Interfaces:
AuthorizationSupport
AuthorizationSupport- Since:
- v4.3
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAuthorizationSupport(GlobalPermissionManager globalPermissionManager, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasGlobalPermission(GlobalPermissionKey globalPermissionKey) Returns true if the logged in user has the given global permission.booleanhasGlobalPermission(String permissionKey) Returns true if the logged in user has the given global permission.booleanhasIssuePermission(int permissionsId, Issue issue) Returns true if the logged in user has the given permission type on the given Issue.booleanhasIssuePermission(ProjectPermissionKey projectPermissionKey, Issue issue) Returns true if the logged in user has the given permission on the given Issue.booleanhasIssuePermission(String permissionKey, Issue issue) Returns true if the logged in user has the given permission type on the given Issue.booleanhasPermission(int permissionsId) Returns true if the logged in user has the given permission type.booleanhasProjectPermission(int permissionsId, Project project) Returns true if the logged in user has the given permission type on the given Project.booleanhasProjectPermission(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:AuthorizationSupportReturns true if the logged in user has the given permission type.- Specified by:
hasPermissionin interfaceAuthorizationSupport- Parameters:
permissionsId- the permission type- Returns:
- true if the logged in user has the given permission type.
-
hasGlobalPermission
Description copied from interface:AuthorizationSupportReturns 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:
hasGlobalPermissionin 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:AuthorizationSupportReturns 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
GlobalPermissionKeyfor correct values of the system permissions.- Specified by:
hasGlobalPermissionin 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:AuthorizationSupportReturns 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
ProjectPermissionsfor correct values of the system permissions.- Specified by:
hasIssuePermissionin 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:AuthorizationSupportReturns true if the logged in user has the given permission type on the given Issue.- Specified by:
hasIssuePermissionin 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:AuthorizationSupportReturns true if the logged in user has the given permission on the given Issue.- Specified by:
hasIssuePermissionin 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:AuthorizationSupportReturns true if the logged in user has the given permission type on the given Project.- Specified by:
hasProjectPermissionin 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:AuthorizationSupportReturns true if the logged in user has the given permission on the given project.- Specified by:
hasProjectPermissionin interfaceAuthorizationSupport- Parameters:
projectPermissionKey- the permission to checkproject- the project- Returns:
- true if the logged in user has the given permission on the given Issue.
-