|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.bc.projectroles.DefaultProjectRoleService
public class DefaultProjectRoleService
Default implementation of the ProjectRoleService
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.jira.bc.projectroles.ProjectRoleService |
|---|
PROJECTROLE_ISSUE_SECURITY_TYPE, PROJECTROLE_NOTIFICATION_TYPE, PROJECTROLE_PERMISSION_TYPE |
| Constructor Summary | |
|---|---|
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)
|
|
| Method Summary | |
|---|---|
void |
addActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
Project project,
String actorType,
ErrorCollection errorCollection)
Will add project role actor associations for the given actors and checking
the currentUser has the correct permissions to perform the update operation. |
void |
addDefaultActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
String type,
ErrorCollection errorCollection)
Will add default role actor associations based off the passed in actors and checking
the currentUser has the correct permissions to perform the update operation. |
ProjectRole |
createProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
Will create the project role with the given projectRole.getName(),
projectRole.getDescription() and checking the currentUser has the correct permissions
to perform the create operation. |
void |
deleteProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
Will delete the given projectRole and checks
the currentUser has the correct permissions to perform the delete operation. |
Collection<org.ofbiz.core.entity.GenericValue> |
getAssociatedIssueSecuritySchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
Will get all issue security scheme's that the specified projectRole is currently used in. |
Collection |
getAssociatedNotificationSchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
Will get all notification scheme's that the specified projectRole is currently used in. |
Collection<org.ofbiz.core.entity.GenericValue> |
getAssociatedPermissionSchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
Will get all permission scheme's that the specified projectRole is currently used in. |
org.apache.commons.collections.MultiMap |
getAssociatedWorkflows(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
Returns workflows and their actions that are associated with the given ProjectRole. |
DefaultRoleActors |
getDefaultRoleActors(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
Will return a DefaultRoleActors for the given projectRole checking the currentUser
has the correct permissions to perform the get operation. |
Map<Long,List<String>> |
getProjectIdsForUserInGroupsBecauseOfRole(com.atlassian.crowd.embedded.api.User currentUser,
List<Long> projectsToLimitBy,
ProjectRole projectRole,
String projectRoleType,
String userName,
ErrorCollection errorCollection)
Returns a Map of Lists. |
ProjectRole |
getProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Long id,
ErrorCollection errorCollection)
Will return the project role with the given id, and checking the currentUser
has the correct permissions to perform the operation. |
ProjectRoleActors |
getProjectRoleActors(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
Project project,
ErrorCollection errorCollection)
Will return a {@link ProjectRoleActors) for the given projectRole and project checking
the currentUser has the correct permissions to perform the get operation. |
ProjectRole |
getProjectRoleByName(com.atlassian.crowd.embedded.api.User currentUser,
String name,
ErrorCollection errorCollection)
Will return the project role with the given name, and checking the currentUser
has the correct permissions to perform the operation. |
Collection<ProjectRole> |
getProjectRoles(com.atlassian.crowd.embedded.api.User currentUser,
ErrorCollection errorCollection)
Get all the ProjectRoles available in JIRA. |
Collection<Project> |
getProjectsContainingRoleActorByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type,
ErrorCollection errorCollection)
Returns the Project's which contain a role actor of the specified name and type within any role. |
boolean |
hasProjectRolePermission(com.atlassian.crowd.embedded.api.User currentUser,
Project project)
Will have permission to modify roles if they are a JIRA admin or, if in enterprise, the user is a project administrator. |
boolean |
isProjectRoleNameUnique(com.atlassian.crowd.embedded.api.User currentUser,
String name,
ErrorCollection errorCollection)
Will tell you if a role name exists or not. |
void |
removeActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
Project project,
String actorType,
ErrorCollection errorCollection)
Will remove project role actor associations for the given actors and checking
the currentUser has the correct permissions to perform the update operation. |
void |
removeAllRoleActorsByNameAndType(String name,
String type)
Will remove all role actors with the specified name and the specified type. |
void |
removeAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type,
ErrorCollection errorCollection)
Will remove all role actors with the specified name and the specified type. |
void |
removeAllRoleActorsByProject(com.atlassian.crowd.embedded.api.User currentUser,
Project project,
ErrorCollection errorCollection)
Will remove all role actors associated with the specified project. |
void |
removeDefaultActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
String actorType,
ErrorCollection errorCollection)
Will remove default actor associations based off the passed in actors, projectRole and
actorType and checking the currentUser has the correct permissions to perform the update operation. |
List<Long> |
roleActorOfTypeExistsForProjects(com.atlassian.crowd.embedded.api.User currentUser,
List<Long> projectsToLimitBy,
ProjectRole projectRole,
String projectRoleType,
String projectRoleParameter,
ErrorCollection errorCollection)
Returns a list of projectId's for which the role actor of the specified type exists in the project for the provided projectRole. |
void |
setActorsForProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Map<String,Set<String>> newRoleActors,
ProjectRole projectRole,
Project project,
ErrorCollection errorCollection)
Will set the project role actor associations for the given newRoleActors and checking
the currentUser has the correct permissions to perform the update operation. |
void |
updateProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
Will update projectRole, checking
the currentUser has the correct permissions to perform the update operation. |
ErrorCollection |
validateRemoveAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type)
Will validate removing all role actors with the specified name and the specified type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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)
| Method Detail |
|---|
public Collection<ProjectRole> getProjectRoles(com.atlassian.crowd.embedded.api.User currentUser,
ErrorCollection errorCollection)
ProjectRoleService
getProjectRoles in interface ProjectRoleService
public ProjectRole getProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Long id,
ErrorCollection errorCollection)
ProjectRoleServiceid, and checking the currentUser
has the correct permissions to perform the operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
getProjectRole in interface ProjectRoleServicecurrentUser - the user performing the callid - the id of the ProjectRoleerrorCollection - will contain any errors in calling the method
public ProjectRole getProjectRoleByName(com.atlassian.crowd.embedded.api.User currentUser,
String name,
ErrorCollection errorCollection)
ProjectRoleServicename, and checking the currentUser
has the correct permissions to perform the operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
getProjectRoleByName in interface ProjectRoleServicecurrentUser - the user performing the callname - the name of the project role to returnerrorCollection - will contain any errors in calling the method
public ProjectRole createProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
ProjectRoleServiceprojectRole.getName(),
projectRole.getDescription() and checking the currentUser has the correct permissions
to perform the create operation. The passed in errorCollection will contain any errors that are
generated, such as permission violations.
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 method
public boolean isProjectRoleNameUnique(com.atlassian.crowd.embedded.api.User currentUser,
String name,
ErrorCollection errorCollection)
ProjectRoleService
isProjectRoleNameUnique in interface ProjectRoleServicename - the name of the project role to check
public void deleteProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
ProjectRoleServiceprojectRole and checks
the currentUser has the correct permissions to perform the delete operation.
This will also delete all ProjectRoleActor associations that it is the parent of.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
deleteProjectRole in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the method
public void updateProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
ProjectRoleServiceprojectRole, checking
the currentUser has the correct permissions to perform the update operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
updateProjectRole in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the method
public ProjectRoleActors getProjectRoleActors(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
Project project,
ErrorCollection errorCollection)
ProjectRoleServiceprojectRole and project checking
the currentUser has the correct permissions to perform the get operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
getProjectRoleActors in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the method
public void addActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
Project project,
String actorType,
ErrorCollection errorCollection)
ProjectRoleServiceactors and checking
the currentUser has the correct permissions to perform the update operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
addActorsToProjectRole in interface ProjectRoleServicecurrentUser - the user performing the callactors - is a list of strings that they 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
public void removeActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
Project project,
String actorType,
ErrorCollection errorCollection)
ProjectRoleServiceactors and checking
the currentUser has the correct permissions to perform the update operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
removeActorsFromProjectRole in interface ProjectRoleServicecurrentUser - the user performing the callactors - is a list of strings that they 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
public void setActorsForProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Map<String,Set<String>> newRoleActors,
ProjectRole projectRole,
Project project,
ErrorCollection errorCollection)
ProjectRoleServicenewRoleActors and checking
the currentUser has the correct permissions to perform the update operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
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 method
public DefaultRoleActors getDefaultRoleActors(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
ProjectRoleServiceDefaultRoleActors for the given projectRole checking the currentUser
has the correct permissions to perform the get operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
getDefaultRoleActors in interface ProjectRoleServicecurrentUser - the user performing the call
public void addDefaultActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
String type,
ErrorCollection errorCollection)
ProjectRoleServiceactors and checking
the currentUser has the correct permissions to perform the update operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
addDefaultActorsToProjectRole in interface ProjectRoleServicecurrentUser - the user performing the callactors - is a list of strings that they 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
public void removeDefaultActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
Collection<String> actors,
ProjectRole projectRole,
String actorType,
ErrorCollection errorCollection)
ProjectRoleServiceactors, projectRole and
actorType and checking the currentUser has the correct permissions to perform the update operation.
The passed in errorCollection will contain any errors that are generated, such as permission violations.
removeDefaultActorsFromProjectRole in interface ProjectRoleServicecurrentUser - the user performing the callactors - is a list of strings that they 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
public void removeAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type,
ErrorCollection errorCollection)
ProjectRoleService
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 method
public ErrorCollection validateRemoveAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type)
ProjectRoleService
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)
ProjectRoleService
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(com.atlassian.crowd.embedded.api.User currentUser,
Project project,
ErrorCollection errorCollection)
ProjectRoleService
removeAllRoleActorsByProject in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the method
public Collection getAssociatedNotificationSchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
ProjectRoleService
getAssociatedNotificationSchemes in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the method
public Collection<org.ofbiz.core.entity.GenericValue> getAssociatedIssueSecuritySchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
ProjectRoleService
getAssociatedIssueSecuritySchemes in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the method
public Collection<org.ofbiz.core.entity.GenericValue> getAssociatedPermissionSchemes(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
ProjectRoleService
getAssociatedPermissionSchemes in interface ProjectRoleServicecurrentUser - the user performing the callerrorCollection - will contain any errors in calling the method
public org.apache.commons.collections.MultiMap getAssociatedWorkflows(com.atlassian.crowd.embedded.api.User currentUser,
ProjectRole projectRole,
ErrorCollection errorCollection)
ProjectRoleServiceProjectRole. e.g. InProjectRoleCondition
workflow elements that block workflow transition unless the acting user is
in the ProjectRole.
getAssociatedWorkflows in interface ProjectRoleServicecurrentUser - the acting user.projectRole - the project role.errorCollection - will contain any errors in calling the method
public Collection<Project> getProjectsContainingRoleActorByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
String name,
String type,
ErrorCollection errorCollection)
ProjectRoleServiceProject'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.
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 method
Project'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)
ProjectRoleService
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 method
public Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(com.atlassian.crowd.embedded.api.User currentUser,
List<Long> projectsToLimitBy,
ProjectRole projectRole,
String projectRoleType,
String userName,
ErrorCollection errorCollection)
ProjectRoleService
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 method
public boolean hasProjectRolePermission(com.atlassian.crowd.embedded.api.User currentUser,
Project project)
ProjectRoleService
hasProjectRolePermission in interface ProjectRoleServicecurrentUser - the acting user.project - is the project to check permissions against
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||