Interface ProjectRoleService
- All Known Implementing Classes:
DefaultProjectRoleService
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActorsToProjectRole
(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) Deprecated.void
addActorsToProjectRole
(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) void
addDefaultActorsToProjectRole
(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection) void
addDefaultActorsToProjectRole
(Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection) createProjectRole
(ProjectRole projectRole, ErrorCollection errorCollection) createProjectRole
(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) void
deleteProjectRole
(ProjectRole projectRole, ErrorCollection errorCollection) void
deleteProjectRole
(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) getAssociatedIssueSecuritySchemes
(ProjectRole projectRole, ErrorCollection errorCollection) getAssociatedIssueSecuritySchemes
(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) getAssociatedNotificationSchemes
(ProjectRole projectRole, ErrorCollection errorCollection) getAssociatedNotificationSchemes
(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) getAssociatedPermissionSchemes
(ProjectRole projectRole, ErrorCollection errorCollection) getAssociatedPermissionSchemes
(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) org.apache.commons.collections.MultiMap
getAssociatedWorkflows
(ProjectRole projectRole, ErrorCollection errorCollection) org.apache.commons.collections.MultiMap
getAssociatedWorkflows
(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) getDefaultRoleActors
(ProjectRole projectRole, ErrorCollection collection) getDefaultRoleActors
(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection collection) getProjectIdsForUserInGroupsBecauseOfRole
(ApplicationUser currentUser, List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userName, ErrorCollection errorCollection) getProjectIdsForUserInGroupsBecauseOfRole
(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userName, ErrorCollection errorCollection) getProjectRole
(ApplicationUser currentUser, Long id, ErrorCollection errorCollection) Deprecated.getProjectRole
(Long id, ErrorCollection errorCollection) getProjectRoleActors
(ProjectRole projectRole, Project project, ErrorCollection errorCollection) getProjectRoleActors
(ApplicationUser currentUser, ProjectRole projectRole, Project project, ErrorCollection errorCollection) getProjectRoleByName
(ApplicationUser currentUser, String name, ErrorCollection errorCollection) Deprecated.getProjectRoleByName
(String name, ErrorCollection errorCollection) getProjectRoles
(ApplicationUser currentUser, ErrorCollection errorCollection) Deprecated.getProjectRoles
(ErrorCollection errorCollection) getProjectsContainingRoleActorByNameAndType
(ApplicationUser currentUser, String name, String type, ErrorCollection errorCollection) Deprecated.getProjectsContainingRoleActorByNameAndType
(String name, String type, ErrorCollection errorCollection) boolean
hasProjectRolePermission
(Project project) boolean
hasProjectRolePermission
(ApplicationUser currentUser, Project project) Deprecated.Use#hasProjectRolePermission(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.project.Project)
instead.boolean
isProjectRoleNameUnique
(ApplicationUser currentUser, String name, ErrorCollection errorCollection) Deprecated.boolean
isProjectRoleNameUnique
(String name, ErrorCollection errorCollection) void
removeActorsFromProjectRole
(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) void
removeActorsFromProjectRole
(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) void
removeAllRoleActorsByNameAndType
(ApplicationUser currentUser, String name, String type, ErrorCollection errorCollection) Deprecated.void
removeAllRoleActorsByNameAndType
(String name, String type) Deprecated.UseremoveAllRoleActorsByNameAndType(String, String, com.atlassian.jira.util.ErrorCollection)
(String, String)} instead.void
removeAllRoleActorsByNameAndType
(String name, String type, ErrorCollection errorCollection) void
removeAllRoleActorsByProject
(Project project, ErrorCollection errorCollection) void
removeAllRoleActorsByProject
(ApplicationUser currentUser, Project project, ErrorCollection errorCollection) void
removeDefaultActorsFromProjectRole
(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection) void
removeDefaultActorsFromProjectRole
(Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection) roleActorOfTypeExistsForProjects
(ApplicationUser currentUser, List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter, ErrorCollection errorCollection) roleActorOfTypeExistsForProjects
(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter, ErrorCollection errorCollection) void
setActorsForProjectRole
(ApplicationUser currentUser, Map<String, Set<String>> newRoleActors, ProjectRole projectRole, Project project, ErrorCollection errorCollection) void
setActorsForProjectRole
(Map<String, Set<String>> newRoleActors, ProjectRole projectRole, Project project, ErrorCollection errorCollection) void
swapRole
(ProjectRole role, ProjectRole swapRole) Swaps a role in scheme entities, workflows, comments and worklogs for a replacement role.void
updateProjectRole
(ProjectRole projectRole, ErrorCollection errorCollection) void
updateProjectRole
(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) validateNoRoleUsage
(ProjectRole projectRole) Checks if the given role is not used.validateRemoveAllRoleActorsByNameAndType
(ApplicationUser currentUser, String name, String type) Deprecated.UseremoveAllRoleActorsByNameAndType(String, String)
instead.validateRemoveAllRoleActorsByNameAndType
(String name, String type)
-
Field Details
-
PROJECTROLE_ISSUE_SECURITY_TYPE
- See Also:
-
PROJECTROLE_PERMISSION_TYPE
- See Also:
-
PROJECTROLE_NOTIFICATION_TYPE
- See Also:
-
-
Method Details
-
getProjectRoles
-
getProjectRoles
Collection<ProjectRole> getProjectRoles(ApplicationUser currentUser, ErrorCollection errorCollection) Deprecated.UsegetProjectRoles(com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Get all the ProjectRoles available in JIRA. Currently this list is global.
- Returns:
- The global list of project roles in JIRA
-
getProjectRole
-
getProjectRole
Deprecated.UsegetProjectRole(Long, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will return the project role with the given
id
, and checking thecurrentUser
has the correct permissions to perform the operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
currentUser
- the user performing the callid
- the id of the ProjectRoleerrorCollection
- will contain any errors in calling the method- Returns:
- the ProjectRole for the given id, will return null if no role found
-
getProjectRoleByName
-
getProjectRoleByName
ProjectRole getProjectRoleByName(ApplicationUser currentUser, String name, ErrorCollection errorCollection) Deprecated.UsegetProjectRoleByName(String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0. Will return the project role with the givenname
, and checking thecurrentUser
has the correct permissions to perform the operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
currentUser
- the user performing the callname
- the name of the project role to returnerrorCollection
- will contain any errors in calling the method- Returns:
- the ProjectRole for the given name, will return null if no role found
-
createProjectRole
-
createProjectRole
ProjectRole createProjectRole(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) Deprecated.UsecreateProjectRole(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will create the project role with the given
projectRole.getName()
,projectRole.getDescription()
and checking thecurrentUser
has the correct permissions to perform the create operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
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 method- Returns:
- the ProjectRole object that was created
-
isProjectRoleNameUnique
-
isProjectRoleNameUnique
boolean isProjectRoleNameUnique(ApplicationUser currentUser, String name, ErrorCollection errorCollection) Deprecated.UseisProjectRoleNameUnique(String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will tell you if a role name exists or not.
- Parameters:
name
- the name of the project role to check- Returns:
- true if unique, false if one already exists with that name
-
deleteProjectRole
-
deleteProjectRole
void deleteProjectRole(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) Deprecated.UsedeleteProjectRole(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will delete the given
projectRole
and checks thecurrentUser
has the correct permissions to perform the delete operation. This will also delete all ProjectRoleActor associations that it is the parent of. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
currentUser
- the user performing the callprojectRole
-errorCollection
- will contain any errors in calling the method
-
addActorsToProjectRole
void addActorsToProjectRole(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) -
addActorsToProjectRole
void addActorsToProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) Deprecated.UseaddActorsToProjectRole(java.util.Collection, com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will add project role actor associations for the given
actors
and checking thecurrentUser
has the correct permissions to perform the update operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
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 method
-
removeActorsFromProjectRole
void removeActorsFromProjectRole(Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) -
removeActorsFromProjectRole
void removeActorsFromProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project, String actorType, ErrorCollection errorCollection) Deprecated.UseremoveActorsFromProjectRole(java.util.Collection, com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will remove project role actor associations for the given
actors
and checking thecurrentUser
has the correct permissions to perform the update operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
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 method
-
setActorsForProjectRole
void setActorsForProjectRole(Map<String, Set<String>> newRoleActors, ProjectRole projectRole, Project project, ErrorCollection errorCollection) -
setActorsForProjectRole
void setActorsForProjectRole(ApplicationUser currentUser, Map<String, Set<String>> newRoleActors, ProjectRole projectRole, Project project, ErrorCollection errorCollection) Deprecated.UsesetActorsForProjectRole(java.util.Map, com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will set the project role actor associations for the given
newRoleActors
and checking thecurrentUser
has the correct permissions to perform the update operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
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 method
-
updateProjectRole
-
updateProjectRole
void updateProjectRole(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) Deprecated.UseupdateProjectRole(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0. Will updateprojectRole
, checking thecurrentUser
has the correct permissions to perform the update operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
currentUser
- the user performing the callprojectRole
-errorCollection
- will contain any errors in calling the method
-
getProjectRoleActors
ProjectRoleActors getProjectRoleActors(ProjectRole projectRole, Project project, ErrorCollection errorCollection) -
getProjectRoleActors
ProjectRoleActors getProjectRoleActors(ApplicationUser currentUser, ProjectRole projectRole, Project project, ErrorCollection errorCollection) Deprecated.UsegetProjectRoleActors(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will return a {@link ProjectRoleActors) for the given <code>projectRole</code> and <code>project</code> checking the <code>currentUser</code> has the correct permissions to perform the get operation. The passed in <code>errorCollection</code> will contain any errors that are generated, such as permission violations.
- Parameters:
currentUser
- the user performing the callprojectRole
-project
-errorCollection
- will contain any errors in calling the method- Returns:
- the ProjectRoleActor representing the projectRole and project
-
getDefaultRoleActors
-
getDefaultRoleActors
DefaultRoleActors getDefaultRoleActors(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection collection) Deprecated.UsegetProjectRoleActors(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will return a
DefaultRoleActors
for the givenprojectRole
checking thecurrentUser
has the correct permissions to perform the get operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
currentUser
- the user performing the callprojectRole
-collection
-- Returns:
- the default role actors
-
addDefaultActorsToProjectRole
void addDefaultActorsToProjectRole(Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection) -
addDefaultActorsToProjectRole
void addDefaultActorsToProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, String type, ErrorCollection errorCollection) Deprecated.UseaddActorsToProjectRole(java.util.Collection, com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will add default role actor associations based off the passed in
actors
and checking thecurrentUser
has the correct permissions to perform the update operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
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 method
-
removeDefaultActorsFromProjectRole
void removeDefaultActorsFromProjectRole(Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection) -
removeDefaultActorsFromProjectRole
void removeDefaultActorsFromProjectRole(ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, String actorType, ErrorCollection errorCollection) Deprecated.UseremoveDefaultActorsFromProjectRole(java.util.Collection, com.atlassian.jira.security.roles.ProjectRole, String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will remove default actor associations based off the passed in
actors
,projectRole
andactorType
and checking thecurrentUser
has the correct permissions to perform the update operation. The passed inerrorCollection
will contain any errors that are generated, such as permission violations.- Parameters:
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 method
-
removeAllRoleActorsByNameAndType
-
removeAllRoleActorsByNameAndType
void removeAllRoleActorsByNameAndType(ApplicationUser currentUser, String name, String type, ErrorCollection errorCollection) Deprecated.UseremoveAllRoleActorsByNameAndType(String, String, ErrorCollection)
instead. Since v6.0.Will remove all role actors with the specified name and the specified type. This method should be used to clean up after the actual subject of the role actor has been deleted (ex. deleting a user from the system).
- Parameters:
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 method
-
validateRemoveAllRoleActorsByNameAndType
-
validateRemoveAllRoleActorsByNameAndType
ErrorCollection validateRemoveAllRoleActorsByNameAndType(ApplicationUser currentUser, String name, String type) Deprecated.UseremoveAllRoleActorsByNameAndType(String, String)
instead. Since v6.0.Will validate removing all role actors with the specified name and the specified type. This method should be used before clean up after the actual subject of the role actor has been deleted (ex. deleting a user from the system). Validation error wil be reported when name does not exists, type does not exists or user performing validation does not have administrative rights
- Parameters:
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)- Returns:
- errorCollection will contain any errors in calling the method
-
removeAllRoleActorsByNameAndType
Deprecated.UseremoveAllRoleActorsByNameAndType(String, String, com.atlassian.jira.util.ErrorCollection)
(String, String)} instead. Since v6.0.Will remove all role actors with the specified name and the specified type. This method should be used to clean up after the actual subject of the role actor has been deleted (ex. deleting a user from the system).
- Parameters:
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)
-
removeAllRoleActorsByProject
-
removeAllRoleActorsByProject
void removeAllRoleActorsByProject(ApplicationUser currentUser, Project project, ErrorCollection errorCollection) Deprecated.UseremoveAllRoleActorsByProject(com.atlassian.jira.project.Project, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0. Will remove all role actors associated with the specified project. This method should be used to clean up just before the actual project has been deleted (ex. deleting a project from the system).- Parameters:
currentUser
- the user performing the callproject
-errorCollection
- will contain any errors in calling the method
-
getAssociatedNotificationSchemes
Collection getAssociatedNotificationSchemes(ProjectRole projectRole, ErrorCollection errorCollection) -
getAssociatedNotificationSchemes
Collection getAssociatedNotificationSchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) Deprecated.UsegetAssociatedNotificationSchemes(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will get all notification scheme's that the specified projectRole is currently used in.
- Parameters:
currentUser
- the user performing the callprojectRole
-errorCollection
- will contain any errors in calling the method- Returns:
- a collection of schemes, if no schemes are found this will be an empty collection.
-
getAssociatedPermissionSchemes
-
getAssociatedPermissionSchemes
Collection getAssociatedPermissionSchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) Deprecated.UsegetAssociatedPermissionSchemes(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0. Will get all permission scheme's that the specified projectRole is currently used in.- Parameters:
currentUser
- the user performing the callprojectRole
-errorCollection
- will contain any errors in calling the method- Returns:
- a collection of schemes, if no schemes are found this will be an empty collection.
-
getAssociatedIssueSecuritySchemes
Collection getAssociatedIssueSecuritySchemes(ProjectRole projectRole, ErrorCollection errorCollection) -
getAssociatedIssueSecuritySchemes
Collection getAssociatedIssueSecuritySchemes(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) Deprecated.UsegetAssociatedIssueSecuritySchemes(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Will get all issue security scheme's that the specified projectRole is currently used in.
- Parameters:
currentUser
- the user performing the callprojectRole
-errorCollection
- will contain any errors in calling the method- Returns:
- a collection of schemes, if no schemes are found this will be an empty collection.
-
getAssociatedWorkflows
org.apache.commons.collections.MultiMap getAssociatedWorkflows(ProjectRole projectRole, ErrorCollection errorCollection) -
getAssociatedWorkflows
org.apache.commons.collections.MultiMap getAssociatedWorkflows(ApplicationUser currentUser, ProjectRole projectRole, ErrorCollection errorCollection) Deprecated.UsegetAssociatedWorkflows(com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Returns workflows and their actions that are associated with the given
ProjectRole
. e.g. com.atlassian.jira.workflow.condition.InProjectRoleCondition workflow elements that block workflow transition unless the acting user is in the ProjectRole.- Parameters:
currentUser
- the acting user.projectRole
- the project role.errorCollection
- will contain any errors in calling the method- Returns:
- a possibly empty MultiMap of Workflow objects to List of Actions.
-
getProjectsContainingRoleActorByNameAndType
Collection<Project> getProjectsContainingRoleActorByNameAndType(String name, String type, ErrorCollection errorCollection) -
getProjectsContainingRoleActorByNameAndType
Collection<Project> getProjectsContainingRoleActorByNameAndType(ApplicationUser currentUser, String name, String type, ErrorCollection errorCollection) Deprecated.UsegetProjectsContainingRoleActorByNameAndType(String, String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Returns the
Project
's which contain a role actor of the specified name and type within any role. This is a method that is provided so that you can efficiently tell which users or groups have been associated with any role within projects.- Parameters:
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 method- Returns:
- a collection of
Project
's which have a role which contains the role actor with the specified name and type.
-
roleActorOfTypeExistsForProjects
List<Long> roleActorOfTypeExistsForProjects(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter, ErrorCollection errorCollection) -
roleActorOfTypeExistsForProjects
List<Long> roleActorOfTypeExistsForProjects(ApplicationUser currentUser, List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter, ErrorCollection errorCollection) Deprecated.UseroleActorOfTypeExistsForProjects(java.util.List, com.atlassian.jira.security.roles.ProjectRole, String, String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Returns a list of projectId's for which the role actor of the specified type exists in the project for the provided projectRole. This is a method that is meant to efficiently allow discovery of whether a UserRoleActor exists in a project role for a subset of projects.
- Parameters:
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 method- Returns:
- A list of Long, project id's. If a projectId is in this list then the project contains has a role associated for the passed in actor and project role.
-
getProjectIdsForUserInGroupsBecauseOfRole
Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userName, ErrorCollection errorCollection) -
getProjectIdsForUserInGroupsBecauseOfRole
Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(ApplicationUser currentUser, List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userName, ErrorCollection errorCollection) Deprecated.UsegetProjectIdsForUserInGroupsBecauseOfRole(java.util.List, com.atlassian.jira.security.roles.ProjectRole, String, String, com.atlassian.jira.util.ErrorCollection)
instead. Since v6.0.Returns a Map of Lists. The key of the map is a Long, project id and the value of the map is a list of group names that the user is a member of for the project. This method is meant to provide an efficient means to discover which groups that are associated with a project role implicitly include the specified user in that project role. We allow you to specify a range of projectsToLimitBy so that you can perform only one query to find this information for many projects for a single projectRole.
- Parameters:
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 method- Returns:
- Returns a Map of Lists. The key of the map is a Long, project id and the value of the map is a list of group names that the user is a member of for the project.
-
hasProjectRolePermission
-
hasProjectRolePermission
Deprecated.Use#hasProjectRolePermission(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.project.Project)
instead. Since v6.0.Will have permission to modify roles if they are a JIRA admin or, if in enterprise, the user is a project administrator.
- Parameters:
currentUser
- the acting user.project
- is the project to check permissions against- Returns:
- true if you have permission, false otherwise.
-
validateNoRoleUsage
Checks if the given role is not used. Looks in all schemes, workflows, comments and worklogs.- Parameters:
projectRole
- the project role to check.- Returns:
- ServiceResult containing any errors in validation
-
swapRole
Swaps a role in scheme entities, workflows, comments and worklogs for a replacement role.- Parameters:
role
- the project role that will be replaced.swapRole
- project role that will replace the old role.
-
addActorsToProjectRole(java.util.Collection, com.atlassian.jira.security.roles.ProjectRole, com.atlassian.jira.project.Project, String, com.atlassian.jira.util.ErrorCollection)
instead.