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) |
Modifier and Type | Method and Description |
---|---|
void |
addActorsToProjectRole(Collection<String> actors,
ProjectRole projectRole,
Project project,
String actorType,
ErrorCollection errorCollection) |
void |
addActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
Project project,
String actorType,
ErrorCollection errorCollection) |
void |
addDefaultActorsToProjectRole(Collection<String> actors,
ProjectRole projectRole,
String type,
ErrorCollection errorCollection) |
void |
addDefaultActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
String type,
ErrorCollection errorCollection) |
ProjectRole |
createProjectRole(ProjectRole projectRole,
ErrorCollection errorCollection) |
ProjectRole |
createProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection) |
void |
deleteProjectRole(ProjectRole projectRole,
ErrorCollection errorCollection) |
void |
deleteProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection) |
Collection<org.ofbiz.core.entity.GenericValue> |
getAssociatedIssueSecuritySchemes(ProjectRole projectRole,
ErrorCollection errorCollection) |
Collection |
getAssociatedIssueSecuritySchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection) |
Collection |
getAssociatedNotificationSchemes(ProjectRole projectRole,
ErrorCollection errorCollection) |
Collection |
getAssociatedNotificationSchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection) |
Collection<org.ofbiz.core.entity.GenericValue> |
getAssociatedPermissionSchemes(ProjectRole projectRole,
ErrorCollection errorCollection) |
Collection |
getAssociatedPermissionSchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection) |
org.apache.commons.collections.MultiMap |
getAssociatedWorkflows(ProjectRole projectRole,
ErrorCollection errorCollection) |
org.apache.commons.collections.MultiMap |
getAssociatedWorkflows(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection) |
DefaultRoleActors |
getDefaultRoleActors(ProjectRole projectRole,
ErrorCollection errorCollection) |
DefaultRoleActors |
getDefaultRoleActors(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection) |
Map<Long,List<String>> |
getProjectIdsForUserInGroupsBecauseOfRole(List<Long> projectsToLimitBy,
ProjectRole projectRole,
String projectRoleType,
String userName,
ErrorCollection errorCollection) |
Map<Long,List<String>> |
getProjectIdsForUserInGroupsBecauseOfRole(com.atlassian.crowd.embedded.api.User currentUser,
List<Long> projectsToLimitBy,
ProjectRole projectRole,
String projectRoleType,
String userName,
ErrorCollection errorCollection) |
ProjectRole |
getProjectRole(Long id,
ErrorCollection errorCollection) |
ProjectRole |
getProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Long id,
ErrorCollection errorCollection) |
ProjectRoleActors |
getProjectRoleActors(ProjectRole projectRole,
Project project,
ErrorCollection errorCollection) |
ProjectRoleActors |
getProjectRoleActors(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
Project project,
ErrorCollection errorCollection) |
ProjectRole |
getProjectRoleByName(String name,
ErrorCollection errorCollection) |
ProjectRole |
getProjectRoleByName(com.atlassian.crowd.embedded.api.User currentUser,
String name,
ErrorCollection errorCollection) |
Collection<ProjectRole> |
getProjectRoles(ErrorCollection errorCollection) |
Collection<ProjectRole> |
getProjectRoles(com.atlassian.crowd.embedded.api.User currentUser,
ErrorCollection errorCollection) |
Collection<Project> |
getProjectsContainingRoleActorByNameAndType(String name,
String type,
ErrorCollection errorCollection) |
Collection<Project> |
getProjectsContainingRoleActorByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type,
ErrorCollection errorCollection) |
boolean |
hasProjectRolePermission(Project project) |
boolean |
hasProjectRolePermission(com.atlassian.crowd.embedded.api.User currentUser,
Project project) |
boolean |
isProjectRoleNameUnique(String name,
ErrorCollection errorCollection) |
boolean |
isProjectRoleNameUnique(com.atlassian.crowd.embedded.api.User currentUser,
String name,
ErrorCollection errorCollection) |
void |
removeActorsFromProjectRole(Collection<String> actors,
ProjectRole projectRole,
Project project,
String actorType,
ErrorCollection errorCollection) |
void |
removeActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
Project project,
String actorType,
ErrorCollection errorCollection) |
void |
removeAllRoleActorsByNameAndType(String name,
String type) |
void |
removeAllRoleActorsByNameAndType(String name,
String type,
ErrorCollection errorCollection) |
void |
removeAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type,
ErrorCollection errorCollection) |
void |
removeAllRoleActorsByProject(Project project,
ErrorCollection errorCollection) |
void |
removeAllRoleActorsByProject(com.atlassian.crowd.embedded.api.User currentUser,
Project project,
ErrorCollection errorCollection) |
void |
removeDefaultActorsFromProjectRole(Collection<String> actors,
ProjectRole projectRole,
String actorType,
ErrorCollection errorCollection) |
void |
removeDefaultActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
String actorType,
ErrorCollection errorCollection) |
List<Long> |
roleActorOfTypeExistsForProjects(List<Long> projectsToLimitBy,
ProjectRole projectRole,
String projectRoleType,
String projectRoleParameter,
ErrorCollection errorCollection) |
List<Long> |
roleActorOfTypeExistsForProjects(com.atlassian.crowd.embedded.api.User currentUser,
List<Long> projectsToLimitBy,
ProjectRole projectRole,
String projectRoleType,
String projectRoleParameter,
ErrorCollection errorCollection) |
void |
setActorsForProjectRole(Map<String,Set<String>> newRoleActors,
ProjectRole projectRole,
Project project,
ErrorCollection errorCollection) |
void |
setActorsForProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Map<String,Set<String>> newRoleActors,
ProjectRole projectRole,
Project project,
ErrorCollection errorCollection) |
void |
updateProjectRole(ProjectRole projectRole,
ErrorCollection errorCollection) |
void |
updateProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection) |
ErrorCollection |
validateRemoveAllRoleActorsByNameAndType(String name,
String type) |
ErrorCollection |
validateRemoveAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type) |
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)
public Collection<ProjectRole> getProjectRoles(com.atlassian.crowd.embedded.api.User currentUser, ErrorCollection errorCollection)
getProjectRoles
in interface ProjectRoleService
public ProjectRole getProjectRole(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User currentUser, String name, ErrorCollection errorCollection)
isProjectRoleNameUnique
in interface ProjectRoleService
name
- the name of the project role to checkpublic void deleteProjectRole(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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 addActorsToProjectRole(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User currentUser, ProjectRole projectRole, ErrorCollection errorCollection)
getDefaultRoleActors
in interface ProjectRoleService
currentUser
- the user performing the callpublic void addDefaultActorsToProjectRole(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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 void removeAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User currentUser, Project project)
hasProjectRolePermission
in interface ProjectRoleService
currentUser
- the acting user.project
- is the project to check permissions againstpublic 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 removeActorsFromProjectRole(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection)
removeActorsFromProjectRole
in interface ProjectRoleService
public 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 removeDefaultActorsFromProjectRole(Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection)
removeDefaultActorsFromProjectRole
in interface ProjectRoleService
public 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-2015 Atlassian. All Rights Reserved.