| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.mock.MockProjectRoleManager
public class MockProjectRoleManager
| Nested Class Summary | |
|---|---|
| static class | MockProjectRoleManager.MockProjectRole | 
| static class | MockProjectRoleManager.MockRoleActor | 
| static class | MockProjectRoleManager.MockRoleActorFactory | 
| Nested classes/interfaces inherited from interface com.atlassian.jira.security.roles.ProjectRoleManager | 
|---|
| ProjectRoleManager.ProjectIdToProjectRoleIdsMap | 
| Field Summary | |
|---|---|
| static List<ProjectRole> | DEFAULT_ROLE_TYPES | 
| static ProjectRole | PROJECT_ROLE_TYPE_1 | 
| static ProjectRole | PROJECT_ROLE_TYPE_2 | 
| static ProjectRole | PROJECT_ROLE_TYPE_3 | 
| static ProjectRole | PROJECT_ROLE_TYPE_NULL | 
| Constructor Summary | |
|---|---|
| MockProjectRoleManager() | |
| Method Summary | |
|---|---|
|  void | addRole(ProjectRole projectRole) | 
|  void | applyDefaultsRolesToProject(Project project)This method will insert all the default roles into the role associations for the provided project. | 
|  ProjectRoleManager.ProjectIdToProjectRoleIdsMap | createProjectIdToProjectRolesMap(ApplicationUser user,
                                 Collection<Long> projectIds) | 
|  ProjectRoleManager.ProjectIdToProjectRoleIdsMap | createProjectIdToProjectRolesMap(com.atlassian.crowd.embedded.api.User user,
                                 Collection<Long> projectIds) | 
|  ProjectRole | createRole(ProjectRole projectRole)Creates a project role object | 
|  void | deleteRole(ProjectRole projectRole)Deletes a project role object | 
|  DefaultRoleActors | getDefaultRoleActors(ProjectRole projectRole)This method will return the default role actors for a ProjectRole | 
|  Collection<Long> | getProjectIdsContainingRoleActorByNameAndType(String name,
                                              String type)Returns the project id's which contain a role actor of the specified name and type within any role. | 
|  Map<Long,List<String>> | getProjectIdsForUserInGroupsBecauseOfRole(List<Long> projectsToLimitBy,
                                          ProjectRole projectRole,
                                          String projectRoleType,
                                          String userName)Returns a Map of Lists. | 
|  ProjectRole | getProjectRole(Long id)Retrieves a project role object | 
|  ProjectRole | getProjectRole(String name)Retrieves a project role object by name | 
|  ProjectRoleActors | getProjectRoleActors(ProjectRole projectRole,
                     Project project)This method will retrieve the object that represents the actors associate with the given projectRoleandprojectcontext | 
|  Collection<ProjectRole> | getProjectRoles()Get all the ProjectRoles available in JIRA. | 
|  Collection<ProjectRole> | getProjectRoles(ApplicationUser user,
                Project project)This will return all the ProjectRoles that the user is currently a member of for the given project. | 
|  Collection<ProjectRole> | getProjectRoles(com.atlassian.crowd.embedded.api.User user,
                Project project)This will return all the ProjectRoles that the user is currently a member of for the given project. | 
|  boolean | isRoleNameUnique(String name)Will tell you if a role name exists or not. | 
|  boolean | isUserInProjectRole(ApplicationUser user,
                    ProjectRole projectRole,
                    Project project)Returns true only if the given user is in the given project role for the given project. | 
|  boolean | isUserInProjectRole(com.atlassian.crowd.embedded.api.User user,
                    ProjectRole projectRole,
                    Project project)Returns true only if the given user is in the given project role for the given project. | 
|  void | removeAllRoleActorsByNameAndType(String name,
                                 String type)This will remove all role actors with the specified name and the specified type. | 
|  void | removeAllRoleActorsByProject(Project project)Will remove all role actors associated with the specified project. | 
|  List<Long> | roleActorOfTypeExistsForProjects(List<Long> projectsToLimitBy,
                                 ProjectRole projectRole,
                                 String projectRoleType,
                                 String projectRoleParameter)Returns a list of projectId's for which the role actor of the specified type exists in the project for the provided projectRole. | 
|  void | updateDefaultRoleActors(DefaultRoleActors defaultRoleActors)This method will update the associations of actors for the default projectRole, specified by the given defaultRoleActors object. | 
|  void | updateProjectRoleActors(ProjectRoleActors projectRoleActors)Commits the given ProjectRoleActors to permanent store, saving any updates made. | 
|  void | updateRole(ProjectRole projectRole)Updates a project role object | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final ProjectRole PROJECT_ROLE_TYPE_1
public static final ProjectRole PROJECT_ROLE_TYPE_2
public static final ProjectRole PROJECT_ROLE_TYPE_3
public static final ProjectRole PROJECT_ROLE_TYPE_NULL
public static final List<ProjectRole> DEFAULT_ROLE_TYPES
| Constructor Detail | 
|---|
public MockProjectRoleManager()
| Method Detail | 
|---|
public Collection<ProjectRole> getProjectRoles()
ProjectRoleManager
getProjectRoles in interface ProjectRoleManager
public Collection<ProjectRole> getProjectRoles(ApplicationUser user,
                                               Project project)
ProjectRoleManagerProjectRoles that the user is currently a member of for the given project.
getProjectRoles in interface ProjectRoleManageruser - the userproject - the project
public Collection<ProjectRole> getProjectRoles(com.atlassian.crowd.embedded.api.User user,
                                               Project project)
ProjectRoleManagerProjectRoles that the user is currently a member of for the given project.
getProjectRoles in interface ProjectRoleManageruser - the userproject - the project
public ProjectRole getProjectRole(Long id)
ProjectRoleManager
getProjectRole in interface ProjectRoleManagerpublic ProjectRole getProjectRole(String name)
ProjectRoleManager
getProjectRole in interface ProjectRoleManagerpublic void addRole(ProjectRole projectRole)
public ProjectRole createRole(ProjectRole projectRole)
ProjectRoleManager
createRole in interface ProjectRoleManagerprojectRole - the project role to create, if the id field is non-null then this will be ignored. Only the
                    roles name and description are used by this method.
public boolean isRoleNameUnique(String name)
ProjectRoleManager
isRoleNameUnique in interface ProjectRoleManagername - the name of the project role to check
public void deleteRole(ProjectRole projectRole)
ProjectRoleManager
deleteRole in interface ProjectRoleManagerpublic void updateRole(ProjectRole projectRole)
ProjectRoleManager
updateRole in interface ProjectRoleManager
public ProjectRoleActors getProjectRoleActors(ProjectRole projectRole,
                                              Project project)
ProjectRoleManagerprojectRole
 and project context
getProjectRoleActors in interface ProjectRoleManagerpublic void updateProjectRoleActors(ProjectRoleActors projectRoleActors)
ProjectRoleManager
updateProjectRoleActors in interface ProjectRoleManagerpublic DefaultRoleActors getDefaultRoleActors(ProjectRole projectRole)
ProjectRoleManagerProjectRole
getDefaultRoleActors in interface ProjectRoleManagerpublic void updateDefaultRoleActors(DefaultRoleActors defaultRoleActors)
ProjectRoleManager
updateDefaultRoleActors in interface ProjectRoleManagerpublic void applyDefaultsRolesToProject(Project project)
ProjectRoleManager
applyDefaultsRolesToProject in interface ProjectRoleManagerproject - the project to associate the role defaults with
public void removeAllRoleActorsByNameAndType(String name,
                                             String type)
ProjectRoleManager
removeAllRoleActorsByNameAndType in interface ProjectRoleManagertype - this is the role type parameter, (ex. GroupRoleActor.TYPE, UserRoleActor.TYPE)public void removeAllRoleActorsByProject(Project project)
ProjectRoleManager
removeAllRoleActorsByProject in interface ProjectRoleManagerproject - this is the project that the role actors are associated with
public boolean isUserInProjectRole(ApplicationUser user,
                                   ProjectRole projectRole,
                                   Project project)
ProjectRoleManager
isUserInProjectRole in interface ProjectRoleManageruser - The user to check. If user is null, this will implicitly return false.projectRole - The role.project - The project.
public boolean isUserInProjectRole(com.atlassian.crowd.embedded.api.User user,
                                   ProjectRole projectRole,
                                   Project project)
ProjectRoleManager
isUserInProjectRole in interface ProjectRoleManageruser - The user to check. If user is null, this will implicitly return false.projectRole - The role.project - The project.
public Collection<Long> getProjectIdsContainingRoleActorByNameAndType(String name,
                                                                      String type)
ProjectRoleManager
getProjectIdsContainingRoleActorByNameAndType in interface ProjectRoleManagername - 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 ProjectRoleManager.ProjectIdToProjectRoleIdsMap createProjectIdToProjectRolesMap(com.atlassian.crowd.embedded.api.User user,
                                                                                        Collection<Long> projectIds)
createProjectIdToProjectRolesMap in interface ProjectRoleManager
public List<Long> roleActorOfTypeExistsForProjects(List<Long> projectsToLimitBy,
                                                   ProjectRole projectRole,
                                                   String projectRoleType,
                                                   String projectRoleParameter)
ProjectRoleManager
roleActorOfTypeExistsForProjects in interface ProjectRoleManagerprojectsToLimitBy - 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.
public Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(List<Long> projectsToLimitBy,
                                                                        ProjectRole projectRole,
                                                                        String projectRoleType,
                                                                        String userName)
ProjectRoleManager
getProjectIdsForUserInGroupsBecauseOfRole in interface ProjectRoleManagerprojectsToLimitBy - 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 group
public ProjectRoleManager.ProjectIdToProjectRoleIdsMap createProjectIdToProjectRolesMap(ApplicationUser user,
                                                                                        Collection<Long> projectIds)
createProjectIdToProjectRolesMap in interface ProjectRoleManager| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||