Class DefaultEnvironmentPermissionsService
java.lang.Object
com.atlassian.bamboo.deployments.environments.DefaultEnvironmentPermissionsService
- All Implemented Interfaces:
EnvironmentPermissionsService
public class DefaultEnvironmentPermissionsService
extends Object
implements EnvironmentPermissionsService
-
Constructor Summary
ConstructorDescriptionDefaultEnvironmentPermissionsService
(TransactionAndHibernateTemplate hibernateTemplate, HibernateMutableAclService aclService, BambooAclHelper aclHelper, EnvironmentService environmentService, BambooPermissionManager bambooPermissionManager, BambooUserManager bambooUserManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addAnonymousPermissionsToEnvironment
(long environmentId) boolean
addGroupPermissionsToEnvironment
(long environmentId, @NotNull String groupName, @NotNull List<BambooPermission> permissionsToAdd) boolean
addLoggedInPermissionsToEnvironment
(long environmentId, @NotNull List<BambooPermission> permissionsToAdd) boolean
addUserPermissionsToEnvironment
(long environmentId, @NotNull String username, @NotNull List<BambooPermission> permissionsToAdd) @NotNull List<BambooPermission>
getAnonymousPermissionsForEnvironment
(long environmentId) @NotNull List<BambooPermission>
getGroupPermissionsForEnvironment
(long environmentId, @NotNull String groupName) @NotNull List<BambooPermission>
getLoggedInPermissionsForEnvironment
(long environmentId) @NotNull List<BambooPermission>
getUserPermissionsForEnvironment
(long environmentId, @NotNull String username) listGroupsWithPermissionsForEnvironment
(long environmentId) listUsersWithPermissionsForEnvironment
(long environmentId) @NotNull Collection<BambooPermission>
permissionDependencies
(@NotNull BambooPermission permission) Obtain a collection of Bamboo permissions dependent on the passedpermission
.boolean
removeAnonymousPermissionsFromEnvironment
(long environmentId) boolean
removeGroupPermissionsFromEnvironment
(long environmentId, @NotNull String groupName, @NotNull List<BambooPermission> permissionsToRemove) boolean
removeLoggedInPermissionsFromEnvironment
(long environmentId, @NotNull List<BambooPermission> permissionsToRemove) boolean
removeUserPermissionsFromEnvironment
(long environmentId, @NotNull String username, @NotNull List<BambooPermission> permissionsToRemove) @NotNull Collection<BambooPermission>
Collection of permissions configurable for environments.
-
Constructor Details
-
DefaultEnvironmentPermissionsService
@Inject public DefaultEnvironmentPermissionsService(TransactionAndHibernateTemplate hibernateTemplate, HibernateMutableAclService aclService, BambooAclHelper aclHelper, EnvironmentService environmentService, BambooPermissionManager bambooPermissionManager, BambooUserManager bambooUserManager)
-
-
Method Details
-
listUsersWithPermissionsForEnvironment
@NotNull public @NotNull Iterable<String> listUsersWithPermissionsForEnvironment(long environmentId) - Specified by:
listUsersWithPermissionsForEnvironment
in interfaceEnvironmentPermissionsService
-
getUserPermissionsForEnvironment
@NotNull public @NotNull List<BambooPermission> getUserPermissionsForEnvironment(long environmentId, @NotNull @NotNull String username) - Specified by:
getUserPermissionsForEnvironment
in interfaceEnvironmentPermissionsService
-
addUserPermissionsToEnvironment
public boolean addUserPermissionsToEnvironment(long environmentId, @NotNull @NotNull String username, @NotNull @NotNull List<BambooPermission> permissionsToAdd) - Specified by:
addUserPermissionsToEnvironment
in interfaceEnvironmentPermissionsService
-
removeUserPermissionsFromEnvironment
public boolean removeUserPermissionsFromEnvironment(long environmentId, @NotNull @NotNull String username, @NotNull @NotNull List<BambooPermission> permissionsToRemove) - Specified by:
removeUserPermissionsFromEnvironment
in interfaceEnvironmentPermissionsService
-
listGroupsWithPermissionsForEnvironment
@NotNull public @NotNull Iterable<String> listGroupsWithPermissionsForEnvironment(long environmentId) - Specified by:
listGroupsWithPermissionsForEnvironment
in interfaceEnvironmentPermissionsService
-
getGroupPermissionsForEnvironment
@NotNull public @NotNull List<BambooPermission> getGroupPermissionsForEnvironment(long environmentId, @NotNull @NotNull String groupName) - Specified by:
getGroupPermissionsForEnvironment
in interfaceEnvironmentPermissionsService
-
addGroupPermissionsToEnvironment
public boolean addGroupPermissionsToEnvironment(long environmentId, @NotNull @NotNull String groupName, @NotNull @NotNull List<BambooPermission> permissionsToAdd) - Specified by:
addGroupPermissionsToEnvironment
in interfaceEnvironmentPermissionsService
-
removeGroupPermissionsFromEnvironment
public boolean removeGroupPermissionsFromEnvironment(long environmentId, @NotNull @NotNull String groupName, @NotNull @NotNull List<BambooPermission> permissionsToRemove) - Specified by:
removeGroupPermissionsFromEnvironment
in interfaceEnvironmentPermissionsService
-
getLoggedInPermissionsForEnvironment
@NotNull public @NotNull List<BambooPermission> getLoggedInPermissionsForEnvironment(long environmentId) - Specified by:
getLoggedInPermissionsForEnvironment
in interfaceEnvironmentPermissionsService
-
addLoggedInPermissionsToEnvironment
public boolean addLoggedInPermissionsToEnvironment(long environmentId, @NotNull @NotNull List<BambooPermission> permissionsToAdd) - Specified by:
addLoggedInPermissionsToEnvironment
in interfaceEnvironmentPermissionsService
-
removeLoggedInPermissionsFromEnvironment
public boolean removeLoggedInPermissionsFromEnvironment(long environmentId, @NotNull @NotNull List<BambooPermission> permissionsToRemove) - Specified by:
removeLoggedInPermissionsFromEnvironment
in interfaceEnvironmentPermissionsService
-
getAnonymousPermissionsForEnvironment
@NotNull public @NotNull List<BambooPermission> getAnonymousPermissionsForEnvironment(long environmentId) - Specified by:
getAnonymousPermissionsForEnvironment
in interfaceEnvironmentPermissionsService
-
addAnonymousPermissionsToEnvironment
public boolean addAnonymousPermissionsToEnvironment(long environmentId) - Specified by:
addAnonymousPermissionsToEnvironment
in interfaceEnvironmentPermissionsService
-
removeAnonymousPermissionsFromEnvironment
public boolean removeAnonymousPermissionsFromEnvironment(long environmentId) - Specified by:
removeAnonymousPermissionsFromEnvironment
in interfaceEnvironmentPermissionsService
-
supportedPermissions
Description copied from interface:EnvironmentPermissionsService
Collection of permissions configurable for environments.Ordered by permission importance. Least granting permissions come first.
- Specified by:
supportedPermissions
in interfaceEnvironmentPermissionsService
-
permissionDependencies
@NotNull public @NotNull Collection<BambooPermission> permissionDependencies(@NotNull @NotNull BambooPermission permission) Description copied from interface:EnvironmentPermissionsService
Obtain a collection of Bamboo permissions dependent on the passedpermission
. A dependent permission is expected to always be granted whenever the parent permission is granted too.The result is an effective collection of dependencies, meaning there's no need to recursively traverse the dependency graph.
- Specified by:
permissionDependencies
in interfaceEnvironmentPermissionsService
-