Class RssPermissionManagerImpl
java.lang.Object
com.atlassian.bamboo.deployments.specs.RssPermissionManagerImpl
- All Implemented Interfaces:
RssPermissionManager
-
Constructor Summary
ConstructorDescriptionRssPermissionManagerImpl
(AuditLogService auditLogService, BambooPermissionManager bambooPermissionManager, com.atlassian.bandana.BandanaManager bandanaManager, DeploymentProjectDao deploymentProjectDao, DeploymentProjectService deploymentProjectService, ProjectManager projectManager, RepositoryDefinitionDao repositoryDefinitionDao, RssDeploymentProjectPermissionDao rssDeploymentProjectPermissionDao, RssProjectPermissionDao rssProjectPermissionDao, RssRepositoryPermissionDao rssRepositoryPermissionDao, RssExecutionDirectoryManager rssExecutionDirectoryManager, AdministrationConfigurationAccessor administrationConfigurationAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
disableAllProjectAccess
(long repositoryId) Forbid Bamboo Specs stored in the repository identified byrepositoryId
to create or modify plans in all projects and deployment projects in Bamboo.void
disableAllRepositoriesAccess
(long repositoryId) Forbid Bamboo Specs stored in the repository identified byrepositoryId
to use any linked repositories in Bamboo.void
disableProjectCreation
(long repositoryId) Forbid Bamboo Specs stored in the repository identified byrepositoryId
to create new projects.getAccessibleDeploymentProjects
(long repositoryId) List all deployment projects which can be created or modified by the Bamboo Specs from a repository identified byrepositoryId
.getAccessibleProjects
(long repositoryId) List all build projects in which plans can be created or modified by the Bamboo Specs from a repository identified byrepositoryId
.getAccessibleRepositories
(long repositoryId) List all repositories which can be used by the Bamboo Specs from a repository identified byrepositoryId
.getRepositoriesWithAccessToDeploymentProject
(long projectId) List all repositories which are allowed to create or modify plans inside a deployment project identified byprojectId
.getRepositoriesWithAccessToProject
(long projectId) List all repositories which are allowed to create or modify plans inside a build project identified byprojectId
.getRepositoriesWithAccessToRepository
(long targetRepositoryId) List all repositories which are allowed to use target repository identified bytargetRepositoryId
.void
grantDeploymentProjectAccess
(long projectId, long repositoryId) Allow Bamboo Specs stored in the repository identified byrepositoryId
to modify a deployment project identified byprojectId
.void
grantProjectAccess
(long projectId, long repositoryId) Allow Bamboo Specs stored in the repository identified byrepositoryId
to modify plans in a project identified byprojectId
.void
grantRepositoryAccess
(long targetRepositoryId, long repositoryId) Allow Bamboo Specs stored in the repository identified byrepositoryId
to use repository identified bytargetRepositoryId
.boolean
isAllProjectsAccess
(long repositoryId) Whether a Bamboo Specs stored in the repository identified byrepositoryId
to modify all projects.boolean
isAllRepositoriesAccess
(long repositoryId) Whether a Bamboo Specs stored in the repository identified byrepositoryId
to use all repositories.boolean
isProjectCreationAllowed
(long repositoryId) Whether a Bamboo Specs stored in the repository identified byrepositoryId
are allowed to create new build and deployment projects.void
revokeDeploymentProjectAccess
(long projectId, long repositoryId) Forbid Bamboo Specs stored in the repository identified byrepositoryId
to modify a deployment project identified byprojectId
.void
revokeProjectAccess
(long projectId, long repositoryId) Forbid Bamboo Specs stored in the repository identified byrepositoryId
to modify plans in a project identified byprojectId
.void
revokeRepositoryAccess
(long targetRepositoryId, long repositoryId) Forbid Bamboo Specs stored in the repository identified byrepositoryId
to use a repository identified bytargetRepositoryId
.void
toggleAllProjectRepositoriesAccess
(long repositoryId, @NotNull String projectKey, boolean enabled) Allow or forbid Bamboo Specs stored in the repository identified byrepositoryId
to use all project repositories in plan of project.void
toggleAllProjectsAccess
(long repositoryId, boolean enabled) Allow or forbid Bamboo Specs stored in the repository identified byrepositoryId
to create or modify plans in all projects and deployment projects in Bamboo.void
toggleAllRepositoriesAccess
(long repositoryId, boolean enabled) Allow or forbid Bamboo Specs stored in the repository identified byrepositoryId
to use all linked repositories in plans or deployment projects in Bamboo.void
toggleProjectCreationPermission
(long repositoryId, boolean enabled) Allow or forbid Bamboo Specs stored in the repository identified byrepositoryId
to create new build and deployment projects.
-
Constructor Details
-
RssPermissionManagerImpl
@Inject public RssPermissionManagerImpl(AuditLogService auditLogService, BambooPermissionManager bambooPermissionManager, com.atlassian.bandana.BandanaManager bandanaManager, DeploymentProjectDao deploymentProjectDao, DeploymentProjectService deploymentProjectService, ProjectManager projectManager, RepositoryDefinitionDao repositoryDefinitionDao, RssDeploymentProjectPermissionDao rssDeploymentProjectPermissionDao, RssProjectPermissionDao rssProjectPermissionDao, RssRepositoryPermissionDao rssRepositoryPermissionDao, RssExecutionDirectoryManager rssExecutionDirectoryManager, AdministrationConfigurationAccessor administrationConfigurationAccessor)
-
-
Method Details
-
getAccessibleProjects
Description copied from interface:RssPermissionManager
List all build projects in which plans can be created or modified by the Bamboo Specs from a repository identified byrepositoryId
.- Specified by:
getAccessibleProjects
in interfaceRssPermissionManager
- Parameters:
repositoryId
- ID of the repository- Returns:
- list of project IDs
-
getAccessibleDeploymentProjects
Description copied from interface:RssPermissionManager
List all deployment projects which can be created or modified by the Bamboo Specs from a repository identified byrepositoryId
.- Specified by:
getAccessibleDeploymentProjects
in interfaceRssPermissionManager
- Parameters:
repositoryId
- ID of the repository- Returns:
- list of project IDs
-
getAccessibleRepositories
Description copied from interface:RssPermissionManager
List all repositories which can be used by the Bamboo Specs from a repository identified byrepositoryId
.- Specified by:
getAccessibleRepositories
in interfaceRssPermissionManager
- Parameters:
repositoryId
- ID of the repository- Returns:
- list of vcs repository IDs
-
getRepositoriesWithAccessToProject
Description copied from interface:RssPermissionManager
List all repositories which are allowed to create or modify plans inside a build project identified byprojectId
.- Specified by:
getRepositoriesWithAccessToProject
in interfaceRssPermissionManager
- Parameters:
projectId
- ID of the project- Returns:
- list of repository IDs
-
getRepositoriesWithAccessToDeploymentProject
Description copied from interface:RssPermissionManager
List all repositories which are allowed to create or modify plans inside a deployment project identified byprojectId
.- Specified by:
getRepositoriesWithAccessToDeploymentProject
in interfaceRssPermissionManager
- Parameters:
projectId
- ID of the project- Returns:
- list of repository IDs
-
getRepositoriesWithAccessToRepository
Description copied from interface:RssPermissionManager
List all repositories which are allowed to use target repository identified bytargetRepositoryId
.- Specified by:
getRepositoriesWithAccessToRepository
in interfaceRssPermissionManager
- Parameters:
targetRepositoryId
- ID of the repository- Returns:
- list of repository IDs
-
grantProjectAccess
public void grantProjectAccess(long projectId, long repositoryId) Description copied from interface:RssPermissionManager
Allow Bamboo Specs stored in the repository identified byrepositoryId
to modify plans in a project identified byprojectId
.- Specified by:
grantProjectAccess
in interfaceRssPermissionManager
- Parameters:
projectId
- id of the projectrepositoryId
- id of the repository
-
grantDeploymentProjectAccess
public void grantDeploymentProjectAccess(long projectId, long repositoryId) Description copied from interface:RssPermissionManager
Allow Bamboo Specs stored in the repository identified byrepositoryId
to modify a deployment project identified byprojectId
.- Specified by:
grantDeploymentProjectAccess
in interfaceRssPermissionManager
- Parameters:
projectId
- id of the projectrepositoryId
- id of the repository
-
grantRepositoryAccess
public void grantRepositoryAccess(long targetRepositoryId, long repositoryId) Description copied from interface:RssPermissionManager
Allow Bamboo Specs stored in the repository identified byrepositoryId
to use repository identified bytargetRepositoryId
.- Specified by:
grantRepositoryAccess
in interfaceRssPermissionManager
- Parameters:
targetRepositoryId
- id of the target repositoryrepositoryId
- id of the repository
-
revokeProjectAccess
public void revokeProjectAccess(long projectId, long repositoryId) Description copied from interface:RssPermissionManager
Forbid Bamboo Specs stored in the repository identified byrepositoryId
to modify plans in a project identified byprojectId
.- Specified by:
revokeProjectAccess
in interfaceRssPermissionManager
- Parameters:
projectId
- id of the projectrepositoryId
- id of the repository
-
revokeDeploymentProjectAccess
public void revokeDeploymentProjectAccess(long projectId, long repositoryId) Description copied from interface:RssPermissionManager
Forbid Bamboo Specs stored in the repository identified byrepositoryId
to modify a deployment project identified byprojectId
.- Specified by:
revokeDeploymentProjectAccess
in interfaceRssPermissionManager
- Parameters:
projectId
- id of the projectrepositoryId
- id of the repository
-
revokeRepositoryAccess
public void revokeRepositoryAccess(long targetRepositoryId, long repositoryId) throws AccessDeniedException Description copied from interface:RssPermissionManager
Forbid Bamboo Specs stored in the repository identified byrepositoryId
to use a repository identified bytargetRepositoryId
.- Specified by:
revokeRepositoryAccess
in interfaceRssPermissionManager
- Parameters:
targetRepositoryId
- id of the target repositoryrepositoryId
- id of the repository- Throws:
AccessDeniedException
- if user doesn't have ADMINISTRATION permission to target repository
-
isAllProjectsAccess
public boolean isAllProjectsAccess(long repositoryId) Description copied from interface:RssPermissionManager
Whether a Bamboo Specs stored in the repository identified byrepositoryId
to modify all projects.- Specified by:
isAllProjectsAccess
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository- Returns:
- boolean
-
isAllRepositoriesAccess
public boolean isAllRepositoriesAccess(long repositoryId) Description copied from interface:RssPermissionManager
Whether a Bamboo Specs stored in the repository identified byrepositoryId
to use all repositories.- Specified by:
isAllRepositoriesAccess
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository- Returns:
- boolean
-
isProjectCreationAllowed
Description copied from interface:RssPermissionManager
Whether a Bamboo Specs stored in the repository identified byrepositoryId
are allowed to create new build and deployment projects.- Specified by:
isProjectCreationAllowed
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository- Returns:
- boolean
- Throws:
AccessDeniedException
- if user doesn't have READ permission to repository
-
toggleAllProjectsAccess
public void toggleAllProjectsAccess(long repositoryId, boolean enabled) Description copied from interface:RssPermissionManager
Allow or forbid Bamboo Specs stored in the repository identified byrepositoryId
to create or modify plans in all projects and deployment projects in Bamboo. IMPORTANT: this method switches the global toggle, so calling this method does not remove permissions from single projects is any were granted using theRssPermissionManager.grantProjectAccess(long, long)
orRssPermissionManager.grantDeploymentProjectAccess(long, long)
. Therefore, if you want to completely revoke access you shall also:- Specified by:
toggleAllProjectsAccess
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository
-
toggleAllRepositoriesAccess
public void toggleAllRepositoriesAccess(long repositoryId, boolean enabled) Description copied from interface:RssPermissionManager
Allow or forbid Bamboo Specs stored in the repository identified byrepositoryId
to use all linked repositories in plans or deployment projects in Bamboo. IMPORTANT: this method switches the global toggle, so calling this method does not remove permissions from single repository is any were granted using theRssPermissionManager.grantProjectAccess(long, long)
orRssPermissionManager.grantDeploymentProjectAccess(long, long)
. Therefore, if you want to completely revoke access you shall also: iterate overRssPermissionManager.getAccessibleRepositories(long)
(long)} and callRssPermissionManager.revokeRepositoryAccess(long, long)
- Specified by:
toggleAllRepositoriesAccess
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository
-
toggleAllProjectRepositoriesAccess
public void toggleAllProjectRepositoriesAccess(long repositoryId, @NotNull @NotNull String projectKey, boolean enabled) Description copied from interface:RssPermissionManager
Allow or forbid Bamboo Specs stored in the repository identified byrepositoryId
to use all project repositories in plan of project. IMPORTANT: this method switches the global toggle, so calling this method does not remove permissions from single repository is any were granted using theRssPermissionManager.grantProjectAccess(long, long)
orRssPermissionManager.grantDeploymentProjectAccess(long, long)
. Therefore, if you want to completely revoke access you shall also: iterate overRssPermissionManager.getAccessibleRepositories(long)
(long)} and callRssPermissionManager.revokeRepositoryAccess(long, long)
- Specified by:
toggleAllProjectRepositoriesAccess
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repositoryprojectKey
- key of project
-
toggleProjectCreationPermission
public void toggleProjectCreationPermission(long repositoryId, boolean enabled) Description copied from interface:RssPermissionManager
Allow or forbid Bamboo Specs stored in the repository identified byrepositoryId
to create new build and deployment projects.- Specified by:
toggleProjectCreationPermission
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository
-
disableAllProjectAccess
public void disableAllProjectAccess(long repositoryId) Description copied from interface:RssPermissionManager
Forbid Bamboo Specs stored in the repository identified byrepositoryId
to create or modify plans in all projects and deployment projects in Bamboo. IMPORTANT: this method switches the global toggle, so calling this method does not remove permissions from single projects is any were granted using theRssPermissionManager.grantProjectAccess(long, long)
orRssPermissionManager.grantDeploymentProjectAccess(long, long)
. Therefore, if you want to completely revoke access you shall also: This method does not check permissions.- Specified by:
disableAllProjectAccess
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository
-
disableAllRepositoriesAccess
public void disableAllRepositoriesAccess(long repositoryId) Description copied from interface:RssPermissionManager
Forbid Bamboo Specs stored in the repository identified byrepositoryId
to use any linked repositories in Bamboo. IMPORTANT: this method switches the global toggle, so calling this method does not remove permissions from single repositories is any were granted using the#grantRepositoryAccess(long, Long)
orRssPermissionManager.grantDeploymentProjectAccess(long, long)
. Therefore, if you want to completely revoke access you shall also: This method does not check permissions.- Specified by:
disableAllRepositoriesAccess
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository
-
disableProjectCreation
public void disableProjectCreation(long repositoryId) Description copied from interface:RssPermissionManager
Forbid Bamboo Specs stored in the repository identified byrepositoryId
to create new projects. This method does not check permissions.- Specified by:
disableProjectCreation
in interfaceRssPermissionManager
- Parameters:
repositoryId
- id of the repository
-