public class DefaultProjectRoleService extends Object implements ProjectRoleService
PROJECTROLE_ISSUE_SECURITY_TYPE, PROJECTROLE_NOTIFICATION_TYPE, PROJECTROLE_PERMISSION_TYPE
Constructor and Description |
---|
DefaultProjectRoleService(ProjectRoleManager projectRoleManager,
PermissionManager permissionManager,
JiraAuthenticationContext jiraAuthenticationContext,
RoleActorFactory roleActorFactory,
NotificationSchemeManager notificationSchemeManager,
PermissionSchemeManager permissionSchemeManager,
WorkflowManager workflowManager,
ProjectManager projectManager,
SchemeFactory schemeFactory,
IssueSecurityLevelManager issueSecurityLevelManager,
SharePermissionDeleteUtils sharePermissionDeleteUtils,
IssueSecuritySchemeManager issueSecuritySchemeManager,
com.atlassian.event.api.EventPublisher eventPublisher,
WorklogManager worklogManager,
CommentManager commentManager) |
public DefaultProjectRoleService(ProjectRoleManager projectRoleManager, PermissionManager permissionManager, JiraAuthenticationContext jiraAuthenticationContext, RoleActorFactory roleActorFactory, NotificationSchemeManager notificationSchemeManager, PermissionSchemeManager permissionSchemeManager, WorkflowManager workflowManager, ProjectManager projectManager, SchemeFactory schemeFactory, IssueSecurityLevelManager issueSecurityLevelManager, SharePermissionDeleteUtils sharePermissionDeleteUtils, IssueSecuritySchemeManager issueSecuritySchemeManager, com.atlassian.event.api.EventPublisher eventPublisher, WorklogManager worklogManager, CommentManager commentManager)
public Collection<ProjectRole> getProjectRoles(ApplicationUser currentUser, ErrorCollection errorCollection)
getProjectRoles
in interface ProjectRoleService
public ProjectRole getProjectRole(ApplicationUser currentUser, Long id, ErrorCollection errorCollection)
getProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callid
- the id of the ProjectRoleerrorCollection
- will contain any errors in calling the methodpublic ProjectRole getProjectRoleByName(ApplicationUser currentUser, String name, ErrorCollection errorCollection)
getProjectRoleByName
in interface ProjectRoleService
currentUser
- the user performing the callname
- the name of the project role to returnerrorCollection
- will contain any errors in calling the methodpublic ProjectRole createProjectRole(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
createProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callprojectRole
- can not be null and will contain the name and description for the project role to createerrorCollection
- will contain any errors in calling the methodpublic boolean isProjectRoleNameUnique(ApplicationUser currentUser, String name, ErrorCollection errorCollection)
isProjectRoleNameUnique
in interface ProjectRoleService
name
- the name of the project role to checkpublic void deleteProjectRole(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
deleteProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callerrorCollection
- will contain any errors in calling the methodpublic void updateProjectRole(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
updateProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callerrorCollection
- will contain any errors in calling the methodpublic ProjectRoleActors getProjectRoleActors(ApplicationUser currentUser, ProjectRole projectRole, Project project, ErrorCollection errorCollection)
getProjectRoleActors
in interface ProjectRoleService
currentUser
- the user performing the callerrorCollection
- will contain any errors in calling the methodpublic void setActorsForProjectRole(ApplicationUser currentUser, Map<String,Set<String>> newRoleActors, ProjectRole projectRole, Project project, ErrorCollection errorCollection)
setActorsForProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callnewRoleActors
- is a mapping of actor types to actor parameters that will be set for the project roleprojectRole
- is the project role to associate withproject
- is the project to associate witherrorCollection
- will contain any errors in calling the methodpublic DefaultRoleActors getDefaultRoleActors(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getDefaultRoleActors
in interface ProjectRoleService
currentUser
- the user performing the callpublic void removeAllRoleActorsByNameAndType(ApplicationUser currentUser, String name, String type, ErrorCollection errorCollection)
removeAllRoleActorsByNameAndType
in interface ProjectRoleService
currentUser
- the user performing the callname
- this is the name that the role actor is stored under (ex. username of 'admin', group name of
'jira-users')type
- this is the role type parameter, (ex. GroupRoleActor.TYPE, UserRoleActor.TYPE)errorCollection
- will contain any errors in calling the methodpublic ErrorCollection validateRemoveAllRoleActorsByNameAndType(ApplicationUser currentUser, String name, String type)
validateRemoveAllRoleActorsByNameAndType
in interface ProjectRoleService
currentUser
- the user performing the callname
- this is the name that the role actor is stored under (ex. username of 'admin', group name of
'jira-users')type
- this is the role type parameter, (ex. GroupRoleActor.TYPE, UserRoleActor.TYPE)public void removeAllRoleActorsByNameAndType(String name, String type)
removeAllRoleActorsByNameAndType
in interface ProjectRoleService
name
- this is the name that the role actor is stored under (ex. username of 'admin', group name of
'jira-users')type
- this is the role type parameter, (ex. GroupRoleActor.TYPE, UserRoleActor.TYPE)public void removeAllRoleActorsByProject(ApplicationUser currentUser, Project project, ErrorCollection errorCollection)
removeAllRoleActorsByProject
in interface ProjectRoleService
currentUser
- the user performing the callerrorCollection
- will contain any errors in calling the methodpublic Collection getAssociatedNotificationSchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedNotificationSchemes
in interface ProjectRoleService
currentUser
- the user performing the callerrorCollection
- will contain any errors in calling the methodpublic Collection<org.ofbiz.core.entity.GenericValue> getAssociatedIssueSecuritySchemes(ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedIssueSecuritySchemes
in interface ProjectRoleService
public Collection getAssociatedIssueSecuritySchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedIssueSecuritySchemes
in interface ProjectRoleService
currentUser
- the user performing the callerrorCollection
- will contain any errors in calling the methodpublic Collection getAssociatedPermissionSchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedPermissionSchemes
in interface ProjectRoleService
currentUser
- the user performing the callerrorCollection
- will contain any errors in calling the methodpublic org.apache.commons.collections.MultiMap getAssociatedWorkflows(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedWorkflows
in interface ProjectRoleService
currentUser
- the acting user.projectRole
- the project role.errorCollection
- will contain any errors in calling the methodpublic Collection<Project> getProjectsContainingRoleActorByNameAndType(ApplicationUser currentUser, String name, String type, ErrorCollection errorCollection)
getProjectsContainingRoleActorByNameAndType
in interface ProjectRoleService
currentUser
- the acting user.name
- this is the name that the role actor is stored under (ex. username of 'admin', group name of
'jira-users')type
- this is the role type parameter, (ex. GroupRoleActor.TYPE, UserRoleActor.TYPE)errorCollection
- will contain any errors in calling the methodProject
's which have a role which contains the role actor with the
specified name and type.public List<Long> roleActorOfTypeExistsForProjects(ApplicationUser currentUser, List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter, ErrorCollection errorCollection)
roleActorOfTypeExistsForProjects
in interface ProjectRoleService
currentUser
- the acting user.projectsToLimitBy
- this will limit the range of projects the method queries. This is a list of Long, project
id's. The returned list will be either the same as this list or a subset.projectRole
- the project role to find out if an actor is a member of.projectRoleType
- the type of role actor you want to query for, in most cases this will be UserRoleActor.TYPE.projectRoleParameter
- the parameter describing the role actor, in the case of a UserRoleActor this will be
the username.errorCollection
- will contain any errors in calling the methodpublic Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(ApplicationUser currentUser, List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userName, ErrorCollection errorCollection)
getProjectIdsForUserInGroupsBecauseOfRole
in interface ProjectRoleService
currentUser
- the acting user.projectsToLimitBy
- this will limit the range of projects the method queries. This is a list of Long, project
id's. The returned list will be either the same as this list or a subset.projectRole
- the project role to find out if an actor is a member of.projectRoleType
- the type of role actor you want to query for, in most cases this will be UserRoleActor.TYPE.userName
- the username to find out if the user is in the role because of a grouperrorCollection
- will contain any errors in calling the methodpublic boolean hasProjectRolePermission(ApplicationUser currentUser, Project project)
hasProjectRolePermission
in interface ProjectRoleService
currentUser
- the acting user.project
- is the project to check permissions againstpublic ServiceResult validateNoRoleUsage(ProjectRole projectRole)
ProjectRoleService
validateNoRoleUsage
in interface ProjectRoleService
projectRole
- the project role to check.public void swapRole(ProjectRole role, ProjectRole swapRole)
ProjectRoleService
swapRole
in interface ProjectRoleService
role
- the project role that will be replaced.swapRole
- project role that will replace the old role.public Collection<ProjectRole> getProjectRoles(ErrorCollection errorCollection)
getProjectRoles
in interface ProjectRoleService
public ProjectRole getProjectRole(Long id, ErrorCollection errorCollection)
getProjectRole
in interface ProjectRoleService
public ProjectRole getProjectRoleByName(String name, ErrorCollection errorCollection)
getProjectRoleByName
in interface ProjectRoleService
public ProjectRole createProjectRole(ProjectRole projectRole, ErrorCollection errorCollection)
createProjectRole
in interface ProjectRoleService
public boolean isProjectRoleNameUnique(String name, ErrorCollection errorCollection)
isProjectRoleNameUnique
in interface ProjectRoleService
public void deleteProjectRole(ProjectRole projectRole, ErrorCollection errorCollection)
deleteProjectRole
in interface ProjectRoleService
public void updateProjectRole(ProjectRole projectRole, ErrorCollection errorCollection)
updateProjectRole
in interface ProjectRoleService
public ProjectRoleActors getProjectRoleActors(ProjectRole projectRole, Project project, ErrorCollection errorCollection)
getProjectRoleActors
in interface ProjectRoleService
public DefaultRoleActors getDefaultRoleActors(ProjectRole projectRole, ErrorCollection errorCollection)
getDefaultRoleActors
in interface ProjectRoleService
public void addActorsToProjectRole(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection)
addActorsToProjectRole
in interface ProjectRoleService
public void addActorsToProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection)
addActorsToProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callactors
- is a list of strings (e.g. user keys or group names) that the RoleActor impl should be able to handleprojectRole
- is the project role to associate withproject
- is the project to associate withactorType
- is a type that defines the type of role actor to instantiate (ex./ UserRoleActor.TYPE, GroupRoleActor.TYPE)errorCollection
- will contain any errors in calling the methodpublic void removeActorsFromProjectRole(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection)
removeActorsFromProjectRole
in interface ProjectRoleService
public void removeActorsFromProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection)
removeActorsFromProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callactors
- is a list of strings (e.g. user keys or group names) that the RoleActor impl should be able to handleprojectRole
- is the project role to associate withproject
- is the project to associate withactorType
- is a type that defines the type of role actor to instantiate (ex./ UserRoleActor.TYPE, GroupRoleActor.TYPE)errorCollection
- will contain any errors in calling the methodpublic void setActorsForProjectRole(Map<String,Set<String>> newRoleActors, ProjectRole projectRole, Project project, ErrorCollection errorCollection)
setActorsForProjectRole
in interface ProjectRoleService
public void addDefaultActorsToProjectRole(Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection)
addDefaultActorsToProjectRole
in interface ProjectRoleService
public void addDefaultActorsToProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection)
addDefaultActorsToProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callactors
- is a list of strings (e.g. user keys or group names) that the RoleActor impl should be able to handleprojectRole
- is the project role to associate withtype
- is a type that defines the type of role actor to instantiate (ex./ UserRoleActor.TYPE, GroupRoleActor.TYPE)errorCollection
- will contain any errors in calling the methodpublic void removeDefaultActorsFromProjectRole(Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection)
removeDefaultActorsFromProjectRole
in interface ProjectRoleService
public void removeDefaultActorsFromProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection)
removeDefaultActorsFromProjectRole
in interface ProjectRoleService
currentUser
- the user performing the callactors
- is a list of strings (e.g. user keys or group names) that the RoleActor impl should be able to handleprojectRole
- is the project role to associate withactorType
- is a type that defines the type of role actor to instantiate (ex./ UserRoleActor.TYPE, GroupRoleActor.TYPE)errorCollection
- will contain any errors in calling the methodpublic ErrorCollection validateRemoveAllRoleActorsByNameAndType(String name, String type)
validateRemoveAllRoleActorsByNameAndType
in interface ProjectRoleService
public void removeAllRoleActorsByNameAndType(String name, String type, ErrorCollection errorCollection)
removeAllRoleActorsByNameAndType
in interface ProjectRoleService
public void removeAllRoleActorsByProject(Project project, ErrorCollection errorCollection)
removeAllRoleActorsByProject
in interface ProjectRoleService
public Collection getAssociatedNotificationSchemes(ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedNotificationSchemes
in interface ProjectRoleService
public Collection<org.ofbiz.core.entity.GenericValue> getAssociatedPermissionSchemes(ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedPermissionSchemes
in interface ProjectRoleService
public org.apache.commons.collections.MultiMap getAssociatedWorkflows(ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedWorkflows
in interface ProjectRoleService
public Collection<Project> getProjectsContainingRoleActorByNameAndType(String name, String type, ErrorCollection errorCollection)
getProjectsContainingRoleActorByNameAndType
in interface ProjectRoleService
public List<Long> roleActorOfTypeExistsForProjects(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter, ErrorCollection errorCollection)
roleActorOfTypeExistsForProjects
in interface ProjectRoleService
public Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userName, ErrorCollection errorCollection)
getProjectIdsForUserInGroupsBecauseOfRole
in interface ProjectRoleService
public boolean hasProjectRolePermission(Project project)
hasProjectRolePermission
in interface ProjectRoleService
Copyright © 2002-2021 Atlassian. All Rights Reserved.