Interface ProjectPermissionOverride
- All Known Implementing Classes:
CantCommentProjectPermissionOverride
,CantEditIssueProjectPermissionOverride
,CantTransitionIssueProjectPermissionOverride
public interface ProjectPermissionOverride
Implementations of this module are supposed to provide the decision if the user has the permission to the project.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
static class
Justification of the decision made byhasPermission(ProjectPermissionKey, com.atlassian.jira.project.Project, com.atlassian.jira.user.ApplicationUser)
method. -
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<BooleanQuery>
getPermissionOverrideQuery
(ApplicationUser applicationUser, Collection<Project> projects, ProjectPermissionKey projectPermissionKey) The method returns an optionalBooleanQuery
as a filter, complementing/further restricting the original search criteria.getReason
(ProjectPermissionKey projectPermissionKey, Project project, ApplicationUser applicationUser) The implementation of this method should return a description explaining how does the permission overriding affects if the user has permissions to the selected project.hasIssuePermission
(ProjectPermissionKey projectPermissionKey, Issue issue, ApplicationUser applicationUser) The implementation of this method is supposed to either deny permissions or abstain from decision if the user has permissions to a selected issue.hasPermission
(ProjectPermissionKey projectPermissionKey, Project project, ApplicationUser applicationUser) The implementation of this method is supposed to either deny permissions or abstain from decision if the user has permissions to the selected project.
-
Method Details
-
hasPermission
ProjectPermissionOverride.Decision hasPermission(ProjectPermissionKey projectPermissionKey, Project project, @Nullable ApplicationUser applicationUser) The implementation of this method is supposed to either deny permissions or abstain from decision if the user has permissions to the selected project. It is not allowed to override global permissions and BROWSE permission to the project.- Parameters:
projectPermissionKey
- identifier of the project permission.project
- project to which permissions are overridden. This can be null when check is performed for anonymous user.applicationUser
- whose permissions are going to be overriden.- Returns:
- the decision.
-
hasIssuePermission
@ExperimentalApi default ProjectPermissionOverride.Decision hasIssuePermission(ProjectPermissionKey projectPermissionKey, Issue issue, @Nullable ApplicationUser applicationUser) The implementation of this method is supposed to either deny permissions or abstain from decision if the user has permissions to a selected issue. This check will be performed in addition to the check for the project.- Parameters:
projectPermissionKey
- identifier of the project permission.issue
- issue to which permissions are overridden. This can be null when check is performed for anonymous user.applicationUser
- whose permissions are going to be overriden.- Returns:
- the decision.
- Since:
- 10.4
-
getReason
ProjectPermissionOverride.Reason getReason(ProjectPermissionKey projectPermissionKey, Project project, @Nullable ApplicationUser applicationUser) The implementation of this method should return a description explaining how does the permission overriding affects if the user has permissions to the selected project.- Parameters:
projectPermissionKey
- identifier of the project permission.project
- project to which permissions are checked.applicationUser
- whose permissions are checked. This can be null when check is performed for anonymous user.- Returns:
- the reason.
-
getPermissionOverrideQuery
@ExperimentalApi default Optional<BooleanQuery> getPermissionOverrideQuery(@Nullable ApplicationUser applicationUser, Collection<Project> projects, ProjectPermissionKey projectPermissionKey) The method returns an optionalBooleanQuery
as a filter, complementing/further restricting the original search criteria.- Parameters:
applicationUser
- the user information, ornull
in case there's no user in the current context.projects
- all projects in the search context.projectPermissionKey
- identifier of the project permission.- Returns:
- additional filter for the search, or empty
Optional
instance when nothing to add on the original search.
-