|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.security.roles.DefaultProjectRoleManager
public class DefaultProjectRoleManager
ProjectRoleManager
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.jira.security.roles.ProjectRoleManager |
---|
ProjectRoleManager.ProjectIdToProjectRoleIdsMap |
Constructor Summary | |
---|---|
DefaultProjectRoleManager(ProjectRoleAndActorStore projectRoleAndActorStore)
|
Method Summary | |
---|---|
void |
applyDefaultsRolesToProject(Project project)
This method will insert all the default roles into the role associations for the provided project. |
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 projectRole
and project context |
Collection<ProjectRole> |
getProjectRoles()
Get all the ProjectRoles available in JIRA. |
Collection<ProjectRole> |
getProjectRoles(com.atlassian.crowd.embedded.api.User user,
Project project)
This will return all the ProjectRole s 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(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 |
Constructor Detail |
---|
public DefaultProjectRoleManager(ProjectRoleAndActorStore projectRoleAndActorStore)
Method Detail |
---|
public Collection<ProjectRole> getProjectRoles()
ProjectRoleManager
getProjectRoles
in interface ProjectRoleManager
public Collection<ProjectRole> getProjectRoles(com.atlassian.crowd.embedded.api.User user, Project project)
ProjectRoleManager
ProjectRole
s that the user is currently a member of for the given project.
getProjectRoles
in interface ProjectRoleManager
user
- the userproject
- the project
public ProjectRole getProjectRole(Long id)
ProjectRoleManager
getProjectRole
in interface ProjectRoleManager
public ProjectRole getProjectRole(String name)
ProjectRoleManager
getProjectRole
in interface ProjectRoleManager
public ProjectRole createRole(ProjectRole projectRole)
ProjectRoleManager
createRole
in interface ProjectRoleManager
projectRole
- 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 ProjectRoleManager
name
- the name of the project role to check
public void deleteRole(ProjectRole projectRole)
ProjectRoleManager
deleteRole
in interface ProjectRoleManager
public void updateRole(ProjectRole projectRole)
ProjectRoleManager
updateRole
in interface ProjectRoleManager
public ProjectRoleActors getProjectRoleActors(ProjectRole projectRole, Project project)
ProjectRoleManager
projectRole
and project
context
getProjectRoleActors
in interface ProjectRoleManager
public void updateProjectRoleActors(ProjectRoleActors projectRoleActors)
ProjectRoleManager
updateProjectRoleActors
in interface ProjectRoleManager
public DefaultRoleActors getDefaultRoleActors(ProjectRole projectRole)
ProjectRoleManager
ProjectRole
getDefaultRoleActors
in interface ProjectRoleManager
public void updateDefaultRoleActors(DefaultRoleActors defaultRoleActors)
ProjectRoleManager
updateDefaultRoleActors
in interface ProjectRoleManager
public void applyDefaultsRolesToProject(Project project)
ProjectRoleManager
applyDefaultsRolesToProject
in interface ProjectRoleManager
project
- the project to associate the role defaults withpublic void removeAllRoleActorsByNameAndType(String name, String type)
ProjectRoleManager
removeAllRoleActorsByNameAndType
in interface ProjectRoleManager
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(Project project)
ProjectRoleManager
removeAllRoleActorsByProject
in interface ProjectRoleManager
project
- this is the project that the role actors are associated withpublic boolean isUserInProjectRole(com.atlassian.crowd.embedded.api.User user, ProjectRole projectRole, Project project)
ProjectRoleManager
isUserInProjectRole
in interface ProjectRoleManager
user
- 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 ProjectRoleManager
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 List<Long> roleActorOfTypeExistsForProjects(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter)
ProjectRoleManager
roleActorOfTypeExistsForProjects
in interface ProjectRoleManager
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.
public Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userName)
ProjectRoleManager
getProjectIdsForUserInGroupsBecauseOfRole
in interface ProjectRoleManager
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 group
public ProjectRoleManager.ProjectIdToProjectRoleIdsMap createProjectIdToProjectRolesMap(com.atlassian.crowd.embedded.api.User user, Collection<Long> projectIds)
createProjectIdToProjectRolesMap
in interface ProjectRoleManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |