Package com.atlassian.bamboo.security
Interface BambooPermissionManager
-
- All Known Implementing Classes:
BambooPermissionManagerImpl
public interface BambooPermissionManager
-
-
Field Summary
Fields Modifier and Type Field Description static org.acegisecurity.adapters.PrincipalAcegiUserToken
SYSTEM_AUTHORITY
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
canCreateDeploymentProject()
boolean
canCreatePlan()
Checks if currently logged in user can create new plans.boolean
canCreatePlanInProject(@NotNull Project project)
Checks if currently logged in user can create plans in aproject
.boolean
canCreatePlanInProject(@NotNull String projectKey)
Checks if currently logged in user can create plans in a project identified byprojectKey
.boolean
canCreateProject()
Checks if currently logged in user can create new projects.boolean
canManageAgents()
Returns true if the current user has credentials to manage Bamboo Agents.boolean
canManageElasticBamboo()
Returns true if the current user has credentials to manage Elastic Bamboo.boolean
canManageEphemeralAgents()
Returns true if the current user has credentials to manage Ephemeral Agents.boolean
canRunCustomBuild(@NotNull PlanKey planKey)
org.acegisecurity.acls.Acl
getAcl(@NotNull Object object)
Collection<String>
getAdminGroups()
Get a list of all the groups that have global administration permission@NotNull Collection<String>
getAdminUsers()
Get a list of all the users that have global administration permission@NotNull String
getDefaultUsersGroup()
Collection<org.acegisecurity.acls.Permission>
getPermissionsForPlan(@NotNull PlanKey planKey)
@NotNull Collection<String>
getRestrictedAdminGroups()
Get a list of all the groups that have global restricted administration permission@NotNull Collection<String>
getRestrictedAdminUsers()
Get a list of all the users that have global restricted administration permission@NotNull Collection<String>
getUsePermissionGroups()
Get a list of all the groups that have global read or create plan permission@NotNull Collection<String>
getUsePermissionUsers()
Get a list of all the users that have global read or create plan permissionboolean
hasGlobalPermission(@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)}boolean
hasPermission(@NotNull String username, @NotNull org.acegisecurity.acls.Permission permission, @NotNull Object object)
boolean
hasPermission(@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.boolean
hasPermissionForAuthority(@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.boolean
hasPlanPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull ImmutablePlan plan)
Verify plan accessboolean
hasPlanPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull PlanKey planKey)
Verify plan accessboolean
hasProjectEditPermission(@Nullable Project project)
Deprecated.since 6.2 project EDIT (BambooPermission.WRITE
) permission replaced with ADMIN (BambooPermission.ADMINISTRATION
).boolean
hasProjectPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull Project project)
Checks if currently logged in user has apermission
for aproject
.boolean
hasProjectPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull String projectKey)
Checks if currently logged in user has apermission
for a project identified byprojectKey
.boolean
isAdmin(String username)
Returns true if the user is an admin, false if notboolean
isAllowedToSetGlobalPermission(@NotNull org.acegisecurity.acls.Permission permission)
Returns true if user is allowed to set specific global permissionboolean
isEnableSignup()
boolean
isSystemAdmin(String username)
Returns true if the user is a sysadmin, false if not
-
-
-
Method Detail
-
hasPermission
boolean hasPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull Object object, @Nullable @Nullable org.acegisecurity.Authentication authentication)
Checks whether a permission is granted to access object with given authentication.- 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:
-
hasPermission
com.google.common.base.Predicate<Object> hasPermission(@NotNull @NotNull BambooPermission permission, @Nullable @Nullable org.acegisecurity.Authentication authentication)
Predicate for {link #hasPermission(permission, object, authentication)}- Parameters:
permission
- the permission to check forauthentication
- the authentication/principal whose secure identities will be checked for the permission- Returns:
-
hasPermission
boolean hasPermission(@NotNull @NotNull String username, @NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull Object object)
-
hasPermissionForAuthority
boolean hasPermissionForAuthority(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull Object object, @NotNull @NotNull org.acegisecurity.GrantedAuthority authority)
Checks whether a permission is granted to access object with given authority.- 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:
-
hasPlanPermission
boolean hasPlanPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull PlanKey planKey)
Verify plan access- Parameters:
permission
- permission to checkplanKey
- key of the plan- Returns:
- true iff permission is granted
-
hasPlanPermission
boolean hasPlanPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull ImmutablePlan plan)
Verify plan access- Parameters:
permission
- permission to checkplan
- plan- Returns:
- true iff permission is granted
-
hasProjectPermission
boolean hasProjectPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull String projectKey)
Checks if currently logged in user has apermission
for a project identified byprojectKey
.- 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
boolean hasProjectPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission, @NotNull @NotNull Project project)
Checks if currently logged in user has apermission
for aproject
.- Parameters:
permission
- permission to checkproject
- project to check- Returns:
- true if current user has the permission to the project
-
canCreatePlanInProject
boolean canCreatePlanInProject(@NotNull @NotNull String projectKey)
Checks if currently logged in user can create plans in a project identified byprojectKey
.- 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
boolean canCreatePlanInProject(@NotNull @NotNull Project project)
Checks if currently logged in user can create plans in aproject
.- Parameters:
project
- project to check- Returns:
- true if current user can create plans in the project
-
canCreateProject
boolean canCreateProject()
Checks if currently logged in user can create new projects.- Returns:
- true if current user can create projects
-
canCreatePlan
boolean canCreatePlan()
Checks 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.
- Returns:
- true if current user can create plans
-
canCreateDeploymentProject
boolean canCreateDeploymentProject()
-
hasGlobalPermission
boolean hasGlobalPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission)
-
hasProjectEditPermission
@Deprecated boolean hasProjectEditPermission(@Nullable @Nullable Project project)
Deprecated.since 6.2 project EDIT (BambooPermission.WRITE
) permission replaced with ADMIN (BambooPermission.ADMINISTRATION
). UsehasPermission(Permission, Object, Authentication)
for permission checking.
-
isEnableSignup
boolean isEnableSignup()
-
getPermissionsForPlan
Collection<org.acegisecurity.acls.Permission> getPermissionsForPlan(@NotNull @NotNull PlanKey planKey)
-
getAdminGroups
Collection<String> getAdminGroups()
Get a list of all the groups that have global administration permission- Returns:
- A list of all the groups that have global administration permission
-
getRestrictedAdminGroups
@NotNull @NotNull Collection<String> getRestrictedAdminGroups()
Get a list of all the groups that have global restricted administration permission- Returns:
- A list of all the groups that have global restricted administration permission
-
getUsePermissionGroups
@NotNull @NotNull Collection<String> getUsePermissionGroups()
Get a list of all the groups that have global read or create plan permission- Returns:
- A list of all the groups that have global read or create plan permission
-
getAdminUsers
@NotNull @NotNull Collection<String> getAdminUsers()
Get a list of all the users that have global administration permission- Returns:
- A list of all the users that have global administration permission
-
getRestrictedAdminUsers
@NotNull @NotNull Collection<String> getRestrictedAdminUsers()
Get a list of all the users that have global restricted administration permission- Returns:
- A list of all the users that have global restricted administration permission
-
getUsePermissionUsers
@NotNull @NotNull Collection<String> getUsePermissionUsers()
Get a list of all the users that have global read or create plan permission- Returns:
- A list of all the users that have global read or create plan permission
-
getDefaultUsersGroup
@NotNull @NotNull String getDefaultUsersGroup()
- Returns:
- the name of the default group that users will be added to when they are created
-
isAdmin
boolean isAdmin(String username)
Returns true if the user is an admin, false if not- Parameters:
username
- the user- Returns:
- true if the user is an admin, false if not
-
isSystemAdmin
boolean isSystemAdmin(String username)
Returns true if the user is a sysadmin, false if not- Parameters:
username
- the user- Returns:
- true if the user is a sysadmin, false if not
-
isAllowedToSetGlobalPermission
boolean isAllowedToSetGlobalPermission(@NotNull @NotNull org.acegisecurity.acls.Permission permission)
Returns true if user is allowed to set specific global permission- Parameters:
permission
- permission to check- Returns:
-
canManageElasticBamboo
boolean canManageElasticBamboo()
Returns 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.- Returns:
- true, if current user has permission to configure Elastic Bamboo
-
canManageEphemeralAgents
boolean canManageEphemeralAgents()
Returns 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.- Returns:
- true, if current user has permission to configure Ephemeral Agents
- Since:
- 9.3
-
canManageAgents
boolean canManageAgents()
Returns true if the current user has credentials to manage Bamboo Agents.- Returns:
- true if the current user has permission to manage agents, false otherwise
-
getAcl
org.acegisecurity.acls.Acl getAcl(@NotNull @NotNull Object object)
-
canRunCustomBuild
boolean canRunCustomBuild(@NotNull @NotNull PlanKey planKey)
- Parameters:
planKey
- key of the plan in question- Returns:
- true if the current user is allowed to run custom build of specified plan
-
-