Package com.atlassian.jira.security
Class DefaultInternalProjectPermissionHelper
java.lang.Object
com.atlassian.jira.security.DefaultInternalProjectPermissionHelper
- All Implemented Interfaces:
InternalProjectPermissionHelper
public class DefaultInternalProjectPermissionHelper
extends Object
implements InternalProjectPermissionHelper
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultInternalProjectPermissionHelper(PermissionManager permissionManager, ApplicationProperties applicationProperties) -
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'.
-
Constructor Details
-
DefaultInternalProjectPermissionHelper
public DefaultInternalProjectPermissionHelper(PermissionManager permissionManager, ApplicationProperties applicationProperties)
-
-
Method Details
-
canUserBrowseProject
Description copied from interface:InternalProjectPermissionHelperChecks if the user can see the projects.- Specified by:
canUserBrowseProjectin interfaceInternalProjectPermissionHelper- Parameters:
project- Project to check for 'BROWSE_PROJECTS'.user- User to check the permissions for.- Returns:
- If the user can access the project.
-
hasPermission
public boolean hasPermission(ProjectPermissionKey permissionKey, Project project, ApplicationUser user) Description copied from interface:InternalProjectPermissionHelperPermission checker method that differentiates the behaviour only for 'BROWSE_PROJECTS'. Other permissions are unaffected by the flag.- Specified by:
hasPermissionin interfaceInternalProjectPermissionHelper- 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
Description copied from interface:InternalProjectPermissionHelperGets the list of projects that should be visible for the user based on 'BROWSE_PROJECTS' permission checks. Differentiating based on the FF.- Specified by:
getBrowsableProjectsin interfaceInternalProjectPermissionHelper- Parameters:
user- User to check the permissions for.- Returns:
- Collection of projects visible to the user.
-
getBrowsableProjectsForProjectAction
Description copied from interface:InternalProjectPermissionHelperGets the list of projects that should be visible for the user based onProjectAction. Differentiating based on the FF.- Specified by:
getBrowsableProjectsForProjectActionin interfaceInternalProjectPermissionHelper- Parameters:
user- User to check the permissions for.- Returns:
- Collection of projects visible to the user.
-
getBrowsableProjectsInCategory
public Collection<Project> getBrowsableProjectsInCategory(ApplicationUser user, ProjectCategory projectCategory) Description copied from interface:InternalProjectPermissionHelperGets 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.- Specified by:
getBrowsableProjectsInCategoryin interfaceInternalProjectPermissionHelper- Parameters:
user- User to check the permissions for.projectCategory- Category to get the projects from.- Returns:
- Collection of projects visible to the user.
-
getBrowsableProjectHistory
Description copied from interface:InternalProjectPermissionHelperGets the history of projects that should be visible for the user based on 'BROWSE_PROJECTS' permission checks. Differentiating based on the FF.- Specified by:
getBrowsableProjectHistoryin interfaceInternalProjectPermissionHelper- Parameters:
user- User to check the permissions for.- Returns:
- Collection of projects visible to the user.
-