public class RssPermissionManagerImpl extends Object implements RssPermissionManager
Constructor and Description |
---|
RssPermissionManagerImpl(AuditLogService auditLogService,
BambooPermissionManager bambooPermissionManager,
com.atlassian.bandana.BandanaManager bandanaManager,
DeploymentProjectDao deploymentProjectDao,
DeploymentProjectService deploymentProjectService,
ProjectManager projectManager,
RepositoryDefinitionDao repositoryDefinitionDao,
RssDeploymentProjectPermissionDao rssDeploymentProjectPermissionDao,
RssProjectPermissionDao rssProjectPermissionDao,
RssRepositoryPermissionDao rssRepositoryPermissionDao,
BuildDirectoryManager buildDirectoryManager,
FeatureManager featureManager) |
Modifier and Type | Method and Description |
---|---|
void |
disableAllProjectAccess(long repositoryId)
Forbid Bamboo Specs stored in the repository identified by
repositoryId 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 by
repositoryId to use any linked repositories
in Bamboo. |
List<Long> |
getAccessibleDeploymentProjects(long repositoryId)
List all deployment projects which can be created or modified by the Bamboo Specs from a repository
identified by
repositoryId . |
List<Long> |
getAccessibleProjects(long repositoryId)
List all build projects in which plans can be created or modified by the Bamboo Specs from a repository
identified by
repositoryId . |
List<Long> |
getAccessibleRepositories(long repositoryId)
List all repositories which can be used by the Bamboo Specs from a repository
identified by
repositoryId . |
List<Long> |
getRepositoriesWithAccessToDeploymentProject(long projectId)
List all repositories which are allowed to create or modify plans inside a deployment project identified by
projectId . |
List<Long> |
getRepositoriesWithAccessToProject(long projectId)
List all repositories which are allowed to create or modify plans inside a build project identified by
projectId . |
List<Long> |
getRepositoriesWithAccessToRepository(long targetRepositoryId)
List all repositories which are allowed to use target repository identified by
targetRepositoryId . |
void |
grantDeploymentProjectAccess(long projectId,
long repositoryId)
Allow Bamboo Specs stored in the repository identified by
repositoryId to modify
a deployment project identified by projectId . |
void |
grantProjectAccess(long projectId,
long repositoryId)
Allow Bamboo Specs stored in the repository identified by
repositoryId to modify
plans in a project identified by projectId . |
void |
grantRepositoryAccess(long targetRepositoryId,
long repositoryId)
Allow Bamboo Specs stored in the repository identified by
repositoryId to use
repository identified by targetRepositoryId . |
boolean |
isAllProjectsAccess(long repositoryId)
Whether a Bamboo Specs stored in the repository identified by
repositoryId to modify
all projects. |
boolean |
isAllRepositoriesAccess(long repositoryId)
Whether a Bamboo Specs stored in the repository identified by
repositoryId to use
all repositories. |
void |
revokeDeploymentProjectAccess(long projectId,
long repositoryId)
Forbid Bamboo Specs stored in the repository identified by
repositoryId to modify
a deployment project identified by projectId . |
void |
revokeProjectAccess(long projectId,
long repositoryId)
Forbid Bamboo Specs stored in the repository identified by
repositoryId to modify
plans in a project identified by projectId . |
void |
revokeRepositoryAccess(long targetRepositoryId,
long repositoryId)
Forbid Bamboo Specs stored in the repository identified by
repositoryId to use
a repository identified by targetRepositoryId . |
void |
toggleAllProjectsAccess(long repositoryId,
boolean enabled)
Allow or forbid Bamboo Specs stored in the repository identified by
repositoryId 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 by
repositoryId to use all
linked repositories in plans or deployment projects in Bamboo. |
@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, BuildDirectoryManager buildDirectoryManager, FeatureManager featureManager)
public List<Long> getAccessibleProjects(long repositoryId)
RssPermissionManager
repositoryId
.getAccessibleProjects
in interface RssPermissionManager
repositoryId
- ID of the repositorypublic List<Long> getAccessibleDeploymentProjects(long repositoryId)
RssPermissionManager
repositoryId
.getAccessibleDeploymentProjects
in interface RssPermissionManager
repositoryId
- ID of the repositorypublic List<Long> getAccessibleRepositories(long repositoryId)
RssPermissionManager
repositoryId
.getAccessibleRepositories
in interface RssPermissionManager
repositoryId
- ID of the repositorypublic List<Long> getRepositoriesWithAccessToProject(long projectId)
RssPermissionManager
projectId
.getRepositoriesWithAccessToProject
in interface RssPermissionManager
projectId
- ID of the projectpublic List<Long> getRepositoriesWithAccessToDeploymentProject(long projectId)
RssPermissionManager
projectId
.getRepositoriesWithAccessToDeploymentProject
in interface RssPermissionManager
projectId
- ID of the projectpublic List<Long> getRepositoriesWithAccessToRepository(long targetRepositoryId)
RssPermissionManager
targetRepositoryId
.getRepositoriesWithAccessToRepository
in interface RssPermissionManager
targetRepositoryId
- ID of the repositorypublic void grantProjectAccess(long projectId, long repositoryId)
RssPermissionManager
repositoryId
to modify
plans in a project identified by projectId
.grantProjectAccess
in interface RssPermissionManager
projectId
- id of the projectrepositoryId
- id of the repositorypublic void grantDeploymentProjectAccess(long projectId, long repositoryId)
RssPermissionManager
repositoryId
to modify
a deployment project identified by projectId
.grantDeploymentProjectAccess
in interface RssPermissionManager
projectId
- id of the projectrepositoryId
- id of the repositorypublic void grantRepositoryAccess(long targetRepositoryId, long repositoryId)
RssPermissionManager
repositoryId
to use
repository identified by targetRepositoryId
.grantRepositoryAccess
in interface RssPermissionManager
targetRepositoryId
- id of the target repositoryrepositoryId
- id of the repositorypublic void revokeProjectAccess(long projectId, long repositoryId)
RssPermissionManager
repositoryId
to modify
plans in a project identified by projectId
.revokeProjectAccess
in interface RssPermissionManager
projectId
- id of the projectrepositoryId
- id of the repositorypublic void revokeDeploymentProjectAccess(long projectId, long repositoryId)
RssPermissionManager
repositoryId
to modify
a deployment project identified by projectId
.revokeDeploymentProjectAccess
in interface RssPermissionManager
projectId
- id of the projectrepositoryId
- id of the repositorypublic void revokeRepositoryAccess(long targetRepositoryId, long repositoryId) throws AccessDeniedException
RssPermissionManager
repositoryId
to use
a repository identified by targetRepositoryId
.revokeRepositoryAccess
in interface RssPermissionManager
targetRepositoryId
- id of the target repositoryrepositoryId
- id of the repositoryAccessDeniedException
- if user doesn't have ADMINISTRATION permission to target repositorypublic boolean isAllProjectsAccess(long repositoryId)
RssPermissionManager
repositoryId
to modify
all projects.isAllProjectsAccess
in interface RssPermissionManager
repositoryId
- id of the repositorypublic boolean isAllRepositoriesAccess(long repositoryId)
RssPermissionManager
repositoryId
to use
all repositories.isAllRepositoriesAccess
in interface RssPermissionManager
repositoryId
- id of the repositorypublic void toggleAllProjectsAccess(long repositoryId, boolean enabled)
RssPermissionManager
repositoryId
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 the RssPermissionManager.grantProjectAccess(long, long)
or RssPermissionManager.grantDeploymentProjectAccess(long, long)
.
Therefore, if you want to completely revoke access you shall also:
toggleAllProjectsAccess
in interface RssPermissionManager
repositoryId
- id of the repositorypublic void toggleAllRepositoriesAccess(long repositoryId, boolean enabled)
RssPermissionManager
repositoryId
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 the RssPermissionManager.grantProjectAccess(long, long)
or RssPermissionManager.grantDeploymentProjectAccess(long, long)
.
Therefore, if you want to completely revoke access you shall also:
iterate over RssPermissionManager.getAccessibleRepositories(long)
(long)} and call RssPermissionManager.revokeRepositoryAccess(long, long)
toggleAllRepositoriesAccess
in interface RssPermissionManager
repositoryId
- id of the repositorypublic void disableAllProjectAccess(long repositoryId)
RssPermissionManager
repositoryId
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 the RssPermissionManager.grantProjectAccess(long, long)
or RssPermissionManager.grantDeploymentProjectAccess(long, long)
.
Therefore, if you want to completely revoke access you shall also:
This method does not check permissions.disableAllProjectAccess
in interface RssPermissionManager
repositoryId
- id of the repositorypublic void disableAllRepositoriesAccess(long repositoryId)
RssPermissionManager
repositoryId
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)
or RssPermissionManager.grantDeploymentProjectAccess(long, long)
.
Therefore, if you want to completely revoke access you shall also:
This method does not check permissions.disableAllRepositoriesAccess
in interface RssPermissionManager
repositoryId
- id of the repositoryCopyright © 2018 Atlassian Software Systems Pty Ltd. All rights reserved.