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,
ProjectRoleHandler projectRoleHandler) |
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, ProjectRoleHandler projectRoleHandler)
public Collection<ProjectRole> getProjectRoles(ApplicationUser currentUser, ErrorCollection errorCollection)
getProjectRoles in interface ProjectRoleServicepublic ProjectRole getProjectRole(ApplicationUser currentUser, Long id, ErrorCollection errorCollection)
getProjectRole in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicename - the name of the project role to checkpublic void deleteProjectRole(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
deleteProjectRole in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the methodpublic void updateProjectRole(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
updateProjectRole in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - the user performing the callpublic void removeAllRoleActorsByNameAndType(ApplicationUser currentUser, String name, String type, ErrorCollection errorCollection)
removeAllRoleActorsByNameAndType in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicename - 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 ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the methodpublic Collection getAssociatedNotificationSchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedNotificationSchemes in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicepublic Collection getAssociatedIssueSecuritySchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedIssueSecuritySchemes in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the methodpublic Collection getAssociatedPermissionSchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedPermissionSchemes in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - 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 ProjectRoleServicecurrentUser - the acting user.project - is the project to check permissions againstpublic ServiceResult validateNoRoleUsage(ProjectRole projectRole)
ProjectRoleServicevalidateNoRoleUsage in interface ProjectRoleServiceprojectRole - the project role to check.public void swapRole(ProjectRole role, ProjectRole swapRole)
ProjectRoleServiceswapRole in interface ProjectRoleServicerole - 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 ProjectRoleServicepublic ProjectRole getProjectRole(Long id, ErrorCollection errorCollection)
getProjectRole in interface ProjectRoleServicepublic ProjectRole getProjectRoleByName(String name, ErrorCollection errorCollection)
getProjectRoleByName in interface ProjectRoleServicepublic ProjectRole createProjectRole(ProjectRole projectRole, ErrorCollection errorCollection)
createProjectRole in interface ProjectRoleServicepublic boolean isProjectRoleNameUnique(String name, ErrorCollection errorCollection)
isProjectRoleNameUnique in interface ProjectRoleServicepublic void deleteProjectRole(ProjectRole projectRole, ErrorCollection errorCollection)
deleteProjectRole in interface ProjectRoleServicepublic void updateProjectRole(ProjectRole projectRole, ErrorCollection errorCollection)
updateProjectRole in interface ProjectRoleServicepublic ProjectRoleActors getProjectRoleActors(ProjectRole projectRole, Project project, ErrorCollection errorCollection)
getProjectRoleActors in interface ProjectRoleServicepublic DefaultRoleActors getDefaultRoleActors(ProjectRole projectRole, ErrorCollection errorCollection)
getDefaultRoleActors in interface ProjectRoleServicepublic void addActorsToProjectRole(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection)
addActorsToProjectRole in interface ProjectRoleServicepublic void addActorsToProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection)
addActorsToProjectRole in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicepublic void removeActorsFromProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection)
removeActorsFromProjectRole in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicepublic void addDefaultActorsToProjectRole(Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection)
addDefaultActorsToProjectRole in interface ProjectRoleServicepublic void addDefaultActorsToProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection)
addDefaultActorsToProjectRole in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicepublic void removeDefaultActorsFromProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection)
removeDefaultActorsFromProjectRole in interface ProjectRoleServicecurrentUser - 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 ProjectRoleServicepublic void removeAllRoleActorsByNameAndType(String name, String type, ErrorCollection errorCollection)
removeAllRoleActorsByNameAndType in interface ProjectRoleServicepublic void removeAllRoleActorsByProject(Project project, ErrorCollection errorCollection)
removeAllRoleActorsByProject in interface ProjectRoleServicepublic Collection getAssociatedNotificationSchemes(ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedNotificationSchemes in interface ProjectRoleServicepublic Collection<org.ofbiz.core.entity.GenericValue> getAssociatedPermissionSchemes(ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedPermissionSchemes in interface ProjectRoleServicepublic org.apache.commons.collections.MultiMap getAssociatedWorkflows(ProjectRole projectRole, ErrorCollection errorCollection)
getAssociatedWorkflows in interface ProjectRoleServicepublic Collection<Project> getProjectsContainingRoleActorByNameAndType(String name, String type, ErrorCollection errorCollection)
getProjectsContainingRoleActorByNameAndType in interface ProjectRoleServicepublic List<Long> roleActorOfTypeExistsForProjects(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter, ErrorCollection errorCollection)
roleActorOfTypeExistsForProjects in interface ProjectRoleServicepublic Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userName, ErrorCollection errorCollection)
getProjectIdsForUserInGroupsBecauseOfRole in interface ProjectRoleServicepublic boolean hasProjectRolePermission(Project project)
hasProjectRolePermission in interface ProjectRoleServiceCopyright © 2002-2022 Atlassian. All Rights Reserved.