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 TypeMethodDescriptionboolean
canUserBrowseProject
(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.boolean
hasPermission
(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:InternalProjectPermissionHelper
Checks if the user can see the projects.- Specified by:
canUserBrowseProject
in 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:InternalProjectPermissionHelper
Permission checker method that differentiates the behaviour only for 'BROWSE_PROJECTS'. Other permissions are unaffected by the flag.- Specified by:
hasPermission
in 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:InternalProjectPermissionHelper
Gets the list of projects that should be visible for the user based on 'BROWSE_PROJECTS' permission checks. Differentiating based on the FF.- Specified by:
getBrowsableProjects
in interfaceInternalProjectPermissionHelper
- Parameters:
user
- User to check the permissions for.- Returns:
- Collection of projects visible to the user.
-
getBrowsableProjectsForProjectAction
Description copied from interface:InternalProjectPermissionHelper
Gets the list of projects that should be visible for the user based onProjectAction
. Differentiating based on the FF.- Specified by:
getBrowsableProjectsForProjectAction
in 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:InternalProjectPermissionHelper
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.- Specified by:
getBrowsableProjectsInCategory
in 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:InternalProjectPermissionHelper
Gets the history of projects that should be visible for the user based on 'BROWSE_PROJECTS' permission checks. Differentiating based on the FF.- Specified by:
getBrowsableProjectHistory
in interfaceInternalProjectPermissionHelper
- Parameters:
user
- User to check the permissions for.- Returns:
- Collection of projects visible to the user.
-