Package com.atlassian.bamboo.security
Class BambooPermissionManagerImpl
java.lang.Object
com.atlassian.bamboo.security.BambooPermissionManagerImpl
- All Implemented Interfaces:
BambooPermissionManager
-
Field Summary
FieldsFields inherited from interface com.atlassian.bamboo.security.BambooPermissionManager
SYSTEM_AUTHORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanChecks if currently logged in user can create new plans.booleancanCreatePlanInProject(@NotNull Project project) Checks if currently logged in user can create plans in aproject.booleancanCreatePlanInProject(@NotNull String projectKey) Checks if currently logged in user can create plans in a project identified byprojectKey.booleanChecks if currently logged in user can create new projects.booleanReturns true if the current user has credentials to manage Bamboo Agents.booleanReturns true if the current user has credentials to manage Elastic Bamboo.booleanReturns true if the current user has credentials to manage Ephemeral Agents.booleancanRunCustomBuild(@NotNull PlanKey planKey) protected booleancheckPermissionForObjectIdentity(@NotNull org.acegisecurity.acls.objectidentity.ObjectIdentity identity, @NotNull org.acegisecurity.acls.Permission permission, @NotNull org.acegisecurity.Authentication authentication) protected org.acegisecurity.acls.objectidentity.ObjectIdentitycreateObjectIdentity(@NotNull Object object) org.acegisecurity.acls.Acl@NotNull Collection<String> Get a list of all the groups that have global administration permission@NotNull Collection<String> Get a list of all the users that have global administration permission@NotNull String@NotNull Collection<String> getGroupsWithPermission(BambooPermission permission) Collection<org.acegisecurity.acls.Permission> getPermissionsForPlan(@NotNull PlanKey planKey) @NotNull Collection<String> Get a list of all the groups that have global restricted administration permission@NotNull Collection<String> Get a list of all the users that have global restricted administration permission@NotNull Collection<String> Get a list of all the groups that have global read or create plan permission@NotNull Collection<String> Get a list of all the users that have global read or create plan permission@NotNull Collection<String> getUsersWithPermission(BambooPermission permission) booleanhasGlobalPermission(@NotNull org.acegisecurity.acls.Permission permission) com.google.common.base.Predicate<Object> hasPermission(@NotNull BambooPermission permission, @Nullable org.acegisecurity.Authentication authentication) Predicate for {link #hasPermission(permission, object, authentication)}booleanhasPermission(@NotNull String username, @NotNull org.acegisecurity.acls.Permission permission, @NotNull Object object) protected booleanhasPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull HibernateObjectIdentityImpl objectIdentity, @NotNull org.acegisecurity.Authentication authentication) booleanhasPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull Object object, @Nullable org.acegisecurity.Authentication authentication) Checks whether a permission is granted to access object with given authentication.protected booleanhasPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, @NotNull org.acegisecurity.Authentication authentication) booleanhasPermissionForAuthority(@NotNull org.acegisecurity.acls.Permission permission, @NotNull Object object, @NotNull org.acegisecurity.GrantedAuthority authority) Checks whether a permission is granted to access object with given authority.booleanhasPlanPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull PlanKey planKey) Verify plan accessbooleanhasPlanPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull ImmutablePlan plan) Verify plan accessbooleanhasProjectPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull Project project) Checks if currently logged in user has apermissionfor aproject.booleanhasProjectPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull String projectKey) Checks if currently logged in user has apermissionfor a project identified byprojectKey.booleanReturns true if the user is an admin, false if notbooleanisAllowedToSetGlobalPermission(@NotNull org.acegisecurity.acls.Permission permission) Returns true if user is allowed to set specific global permissionbooleanprotected booleanisPermissionSuppressedByTokenAuthorisation(@NotNull org.acegisecurity.acls.Permission permission) booleanisSystemAdmin(String username) Returns true if the user is a sysadmin, false if notprotected org.acegisecurity.acls.AclreadAclById(org.acegisecurity.acls.objectidentity.ObjectIdentity identity) voidsetAclService(org.acegisecurity.acls.MutableAclService aclService) voidsetAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor) voidsetCachedPlanManager(CachedPlanManager cachedPlanManager) voidsetObjectIdentityRetrievalStrategy(org.acegisecurity.acls.objectidentity.ObjectIdentityRetrievalStrategy objectIdentityRetrievalStrategy) voidsetOverrideAuthorities(org.acegisecurity.GrantedAuthority[] overrideAuthorities) voidsetProjectManager(ProjectManager projectManager) voidsetScopesRequestCacheDelegate(ScopesRequestCacheDelegate scopesRequestCacheDelegate) voidsetSidRetrievalStrategy(org.acegisecurity.acls.sid.SidRetrievalStrategy sidRetrievalStrategy)
-
Field Details
-
aclService
protected org.acegisecurity.acls.MutableAclService aclService
-
-
Constructor Details
-
BambooPermissionManagerImpl
public BambooPermissionManagerImpl()
-
-
Method Details
-
hasPermission
public boolean hasPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull Object object, @Nullable @Nullable org.acegisecurity.Authentication authentication) Description copied from interface:BambooPermissionManagerChecks whether a permission is granted to access object with given authentication.- Specified by:
hasPermissionin interfaceBambooPermissionManager- Parameters:
permission- the permission to check forobject- the domain object on which the permission check will be madeauthentication- the authentication/principal whose secure identities will be checked for the permission- Returns:
-
checkPermissionForObjectIdentity
protected boolean checkPermissionForObjectIdentity(@NotNull @NotNull org.acegisecurity.acls.objectidentity.ObjectIdentity identity, @NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull org.acegisecurity.Authentication authentication) -
isPermissionSuppressedByTokenAuthorisation
protected boolean isPermissionSuppressedByTokenAuthorisation(@NotNull @NotNull org.acegisecurity.acls.Permission permission) -
hasPermission
public com.google.common.base.Predicate<Object> hasPermission(@NotNull @NotNull BambooPermission permission, @Nullable @Nullable org.acegisecurity.Authentication authentication) Description copied from interface:BambooPermissionManagerPredicate for {link #hasPermission(permission, object, authentication)}- Specified by:
hasPermissionin interfaceBambooPermissionManager- Parameters:
permission- the permission to check forauthentication- the authentication/principal whose secure identities will be checked for the permission- Returns:
-
hasPermissionForAuthority
public boolean hasPermissionForAuthority(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull Object object, @NotNull @NotNull org.acegisecurity.GrantedAuthority authority) Description copied from interface:BambooPermissionManagerChecks whether a permission is granted to access object with given authority.- Specified by:
hasPermissionForAuthorityin interfaceBambooPermissionManager- Parameters:
permission- the permission to check forobject- the domain object on which the permission check will be madeauthority- the authority whose secure identities will be checked for the permission- Returns:
-
getAcl
- Specified by:
getAclin interfaceBambooPermissionManager
-
readAclById
protected org.acegisecurity.acls.Acl readAclById(org.acegisecurity.acls.objectidentity.ObjectIdentity identity) -
hasPermission
public boolean hasPermission(@NotNull @NotNull String username, @NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull Object object) - Specified by:
hasPermissionin interfaceBambooPermissionManager
-
hasPlanPermission
public boolean hasPlanPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull PlanKey planKey) Description copied from interface:BambooPermissionManagerVerify plan access- Specified by:
hasPlanPermissionin interfaceBambooPermissionManager- Parameters:
permission- permission to checkplanKey- key of the plan- Returns:
- true iff permission is granted
-
hasPlanPermission
public boolean hasPlanPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull ImmutablePlan plan) Description copied from interface:BambooPermissionManagerVerify plan access- Specified by:
hasPlanPermissionin interfaceBambooPermissionManager- Parameters:
permission- permission to checkplan- plan- Returns:
- true iff permission is granted
-
hasProjectPermission
public boolean hasProjectPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull String projectKey) Description copied from interface:BambooPermissionManagerChecks if currently logged in user has apermissionfor a project identified byprojectKey.- Specified by:
hasProjectPermissionin interfaceBambooPermissionManager- Parameters:
permission- permission to checkprojectKey- key of the project to check- Returns:
- true if project with the given key exists and current user has the permission to it
-
hasProjectPermission
public boolean hasProjectPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull Project project) Description copied from interface:BambooPermissionManagerChecks if currently logged in user has apermissionfor aproject.- Specified by:
hasProjectPermissionin interfaceBambooPermissionManager- Parameters:
permission- permission to checkproject- project to check- Returns:
- true if current user has the permission to the project
-
canCreatePlanInProject
Description copied from interface:BambooPermissionManagerChecks if currently logged in user can create plans in a project identified byprojectKey.- Specified by:
canCreatePlanInProjectin interfaceBambooPermissionManager- Parameters:
projectKey- key of the project to check- Returns:
- true if project with the given key exists and current user can create plans in it
-
canCreatePlanInProject
Description copied from interface:BambooPermissionManagerChecks if currently logged in user can create plans in aproject.- Specified by:
canCreatePlanInProjectin interfaceBambooPermissionManager- Parameters:
project- project to check- Returns:
- true if current user can create plans in the project
-
canCreateProject
public boolean canCreateProject()Description copied from interface:BambooPermissionManagerChecks if currently logged in user can create new projects.- Specified by:
canCreateProjectin interfaceBambooPermissionManager- Returns:
- true if current user can create projects
-
canCreatePlan
public boolean canCreatePlan()Description copied from interface:BambooPermissionManagerChecks if currently logged in user can create new plans.This method might be expensive to compute as it may need to check permissions on all projects for this Bamboo instance.
- Specified by:
canCreatePlanin interfaceBambooPermissionManager- Returns:
- true if current user can create plans
-
canCreateDeploymentProject
public boolean canCreateDeploymentProject()- Specified by:
canCreateDeploymentProjectin interfaceBambooPermissionManager
-
hasGlobalPermission
public boolean hasGlobalPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission) - Specified by:
hasGlobalPermissionin interfaceBambooPermissionManager
-
getPermissionsForPlan
public Collection<org.acegisecurity.acls.Permission> getPermissionsForPlan(@NotNull @NotNull PlanKey planKey) - Specified by:
getPermissionsForPlanin interfaceBambooPermissionManager
-
isEnableSignup
public boolean isEnableSignup()- Specified by:
isEnableSignupin interfaceBambooPermissionManager
-
getAdminGroups
Description copied from interface:BambooPermissionManagerGet a list of all the groups that have global administration permission- Specified by:
getAdminGroupsin interfaceBambooPermissionManager- Returns:
- A list of all the groups that have global administration permission
-
getRestrictedAdminGroups
Description copied from interface:BambooPermissionManagerGet a list of all the groups that have global restricted administration permission- Specified by:
getRestrictedAdminGroupsin interfaceBambooPermissionManager- Returns:
- A list of all the groups that have global restricted administration permission
-
getUsePermissionGroups
Description copied from interface:BambooPermissionManagerGet a list of all the groups that have global read or create plan permission- Specified by:
getUsePermissionGroupsin interfaceBambooPermissionManager- Returns:
- A list of all the groups that have global read or create plan permission
-
getDefaultUsersGroup
- Specified by:
getDefaultUsersGroupin interfaceBambooPermissionManager- Returns:
- the name of the default group that users will be added to when they are created
-
getGroupsWithPermission
-
getAdminUsers
Description copied from interface:BambooPermissionManagerGet a list of all the users that have global administration permission- Specified by:
getAdminUsersin interfaceBambooPermissionManager- Returns:
- A list of all the users that have global administration permission
-
getRestrictedAdminUsers
Description copied from interface:BambooPermissionManagerGet a list of all the users that have global restricted administration permission- Specified by:
getRestrictedAdminUsersin interfaceBambooPermissionManager- Returns:
- A list of all the users that have global restricted administration permission
-
getUsePermissionUsers
Description copied from interface:BambooPermissionManagerGet a list of all the users that have global read or create plan permission- Specified by:
getUsePermissionUsersin interfaceBambooPermissionManager- Returns:
- A list of all the users that have global read or create plan permission
-
getUsersWithPermission
-
isAdmin
Description copied from interface:BambooPermissionManagerReturns true if the user is an admin, false if not- Specified by:
isAdminin interfaceBambooPermissionManager- Parameters:
username- the user- Returns:
- true if the user is an admin, false if not
-
isSystemAdmin
Description copied from interface:BambooPermissionManagerReturns true if the user is a sysadmin, false if not- Specified by:
isSystemAdminin interfaceBambooPermissionManager- Parameters:
username- the user- Returns:
- true if the user is a sysadmin, false if not
-
isAllowedToSetGlobalPermission
public boolean isAllowedToSetGlobalPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission) Description copied from interface:BambooPermissionManagerReturns true if user is allowed to set specific global permission- Specified by:
isAllowedToSetGlobalPermissionin interfaceBambooPermissionManager- Parameters:
permission- permission to check- Returns:
-
canManageElasticBamboo
public boolean canManageElasticBamboo()Description copied from interface:BambooPermissionManagerReturns true if the current user has credentials to manage Elastic Bamboo. Note that this permission is only required for Elastic Bamboo configuration (including operations like viewing EC2 instances, their statuses, logs etc.). Normal usage of Bamboo with EC2 configured (e.g. running builds on elastic agents) does not require such credentials.- Specified by:
canManageElasticBambooin interfaceBambooPermissionManager- Returns:
- true, if current user has permission to configure Elastic Bamboo
-
canManageEphemeralAgents
public boolean canManageEphemeralAgents()Description copied from interface:BambooPermissionManagerReturns true if the current user has credentials to manage Ephemeral Agents. Note that this permission is only required for Ephemeral Agents configuration (including operations like viewing templates). Normal usage of Bamboo with Ephemeral Agents configured (e.g. running builds) does not require such credentials.- Specified by:
canManageEphemeralAgentsin interfaceBambooPermissionManager- Returns:
- true, if current user has permission to configure Ephemeral Agents
-
canManageAgents
public boolean canManageAgents()Description copied from interface:BambooPermissionManagerReturns true if the current user has credentials to manage Bamboo Agents.- Specified by:
canManageAgentsin interfaceBambooPermissionManager- Returns:
- true if the current user has permission to manage agents, false otherwise
-
canRunCustomBuild
- Specified by:
canRunCustomBuildin interfaceBambooPermissionManager- Parameters:
planKey- key of the plan in question- Returns:
- true if the current user is allowed to run custom build of specified plan
-
hasPermission
protected boolean hasPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull HibernateObjectIdentityImpl objectIdentity, @NotNull @NotNull org.acegisecurity.Authentication authentication) -
hasPermission
protected boolean hasPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, @NotNull @NotNull org.acegisecurity.Authentication authentication) -
createObjectIdentity
protected org.acegisecurity.acls.objectidentity.ObjectIdentity createObjectIdentity(@NotNull @NotNull Object object) -
setAdministrationConfigurationAccessor
public void setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor) -
setAclService
public void setAclService(org.acegisecurity.acls.MutableAclService aclService) -
setSidRetrievalStrategy
public void setSidRetrievalStrategy(org.acegisecurity.acls.sid.SidRetrievalStrategy sidRetrievalStrategy) -
setCachedPlanManager
-
setProjectManager
-
setOverrideAuthorities
public void setOverrideAuthorities(org.acegisecurity.GrantedAuthority[] overrideAuthorities) -
setObjectIdentityRetrievalStrategy
public void setObjectIdentityRetrievalStrategy(org.acegisecurity.acls.objectidentity.ObjectIdentityRetrievalStrategy objectIdentityRetrievalStrategy) -
setScopesRequestCacheDelegate
-