Package com.atlassian.jira.security
Interface InternalProjectPermissionHelper
- All Known Implementing Classes:
DefaultInternalProjectPermissionHelper
public interface InternalProjectPermissionHelper
This helper gathers logic required to switch between two ways of checking permissions to projects.
It is required to enable different behaviour when
APKeys.PROJECT_PERMISSION_HELPER_BETA_FIX_ENABLED
flag is toggled. If it is enabled projects should be hidden for user with access to only some or no issues.-
Method Summary
Modifier and TypeMethodDescriptionbooleancanUserBrowseProject(Project project, ApplicationUser user) Checks if the user can see the projects.Gets the history of projects that should be visible for the user based on 'BROWSE_PROJECTS' permission checks.Gets the list of projects that should be visible for the user based on 'BROWSE_PROJECTS' permission checks.Gets the list of projects that should be visible for the user based onProjectAction.getBrowsableProjectsInCategory(ApplicationUser user, ProjectCategory projectCategory) Gets the list of projects from a given category that should be visible for the user based on 'BROWSE_PROJECTS' permission checks.booleanhasPermission(ProjectPermissionKey permissionKey, Project project, ApplicationUser user) Permission checker method that differentiates the behaviour only for 'BROWSE_PROJECTS'.
-
Method Details
-
canUserBrowseProject
Checks if the user can see the projects.- Parameters:
project- Project to check for 'BROWSE_PROJECTS'.user- User to check the permissions for.- Returns:
- If the user can access the project.
-
hasPermission
Permission checker method that differentiates the behaviour only for 'BROWSE_PROJECTS'. Other permissions are unaffected by the flag.- Parameters:
permissionKey- Permission that's being checked.project- Project against which the permission is tested.user- User to check the permissions for.- Returns:
- If the user can access the project.
-
getBrowsableProjects
Gets the list of projects that should be visible for the user based on 'BROWSE_PROJECTS' permission checks. Differentiating based on the FF.- Parameters:
user- User to check the permissions for.- Returns:
- Collection of projects visible to the user.
-
getBrowsableProjectsForProjectAction
Gets the list of projects that should be visible for the user based onProjectAction. Differentiating based on the FF.- Parameters:
user- User to check the permissions for.- Returns:
- Collection of projects visible to the user.
-
getBrowsableProjectsInCategory
Collection<Project> getBrowsableProjectsInCategory(ApplicationUser user, ProjectCategory projectCategory) Gets the list of projects from a given category that should be visible for the user based on 'BROWSE_PROJECTS' permission checks. Differentiating based on the FF.- Parameters:
user- User to check the permissions for.projectCategory- Category to get the projects from.- Returns:
- Collection of projects visible to the user.
-
getBrowsableProjectHistory
Gets the history of projects that should be visible for the user based on 'BROWSE_PROJECTS' permission checks. Differentiating based on the FF.- Parameters:
user- User to check the permissions for.- Returns:
- Collection of projects visible to the user.
-