public class BambooPermissionManagerImpl extends Object implements BambooPermissionManager
Modifier and Type | Field and Description |
---|---|
protected org.acegisecurity.acls.MutableAclService |
aclService |
SYSTEM_AUTHORITY
Constructor and Description |
---|
BambooPermissionManagerImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateDeploymentProject() |
boolean |
canCreatePlan()
Checks if currently logged in user can create new plans.
|
boolean |
canCreatePlanInProject(Project project)
Checks if currently logged in user can create plans in a
project . |
boolean |
canCreatePlanInProject(String projectKey)
Checks if currently logged in user can create plans in a project identified by
projectKey . |
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 |
canRunCustomBuild(PlanKey planKey) |
protected org.acegisecurity.acls.objectidentity.ObjectIdentity |
createObjectIdentity(Object object) |
org.acegisecurity.acls.Acl |
getAcl(Object object) |
Collection<String> |
getAdminGroups()
Get a list of all the groups that have global administration permission
|
Collection<String> |
getAdminUsers()
Get a list of all the users that have global administration permission
|
String |
getDefaultUsersGroup() |
Collection<String> |
getGroupsWithPermission(BambooPermission permission) |
Collection<org.acegisecurity.acls.Permission> |
getPermissionsForPlan(PlanKey planKey) |
Collection<String> |
getRestrictedAdminGroups()
Get a list of all the groups that have global restricted administration permission
|
Collection<String> |
getRestrictedAdminUsers()
Get a list of all the users that have global restricted administration permission
|
Collection<String> |
getUsePermissionGroups()
Get a list of all the groups that have global read or create plan permission
|
Collection<String> |
getUsePermissionUsers()
Get a list of all the users that have global read or create plan permission
|
Collection<String> |
getUsersWithPermission(BambooPermission permission) |
boolean |
hasGlobalPermission(org.acegisecurity.acls.Permission permission) |
com.google.common.base.Predicate<Object> |
hasPermission(BambooPermission permission,
org.acegisecurity.Authentication authentication)
Predicate for {link #hasPermission(permission, object, authentication)}
|
protected boolean |
hasPermission(org.acegisecurity.acls.Permission permission,
HibernateObjectIdentityImpl objectIdentity,
org.acegisecurity.Authentication authentication) |
boolean |
hasPermission(org.acegisecurity.acls.Permission permission,
Object object,
org.acegisecurity.Authentication authentication)
Checks whether a permission is granted to access object with given authentication.
|
protected boolean |
hasPermission(org.acegisecurity.acls.Permission permission,
org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity,
org.acegisecurity.Authentication authentication) |
boolean |
hasPermission(String username,
org.acegisecurity.acls.Permission permission,
Object object) |
boolean |
hasPermissionForAuthority(org.acegisecurity.acls.Permission permission,
Object object,
org.acegisecurity.GrantedAuthority authority)
Checks whether a permission is granted to access object with given authority.
|
boolean |
hasPlanPermission(org.acegisecurity.acls.Permission permission,
ImmutablePlan plan)
Verify plan access
|
boolean |
hasPlanPermission(org.acegisecurity.acls.Permission permission,
PlanKey planKey)
Verify plan access
|
boolean |
hasProjectEditPermission(Project project) |
boolean |
hasProjectPermission(org.acegisecurity.acls.Permission permission,
Project project)
Checks if currently logged in user has a
permission for a project . |
boolean |
hasProjectPermission(org.acegisecurity.acls.Permission permission,
String projectKey)
Checks if currently logged in user has a
permission for a project identified by projectKey . |
boolean |
isAdmin(String username)
Returns true if the user is an admin, false if not
|
boolean |
isAllowedToSetGlobalPermission(org.acegisecurity.acls.Permission permission)
Returns true if user is allowed to set specific global permission
|
boolean |
isEnableSignup() |
protected boolean |
isPermissionSuppressedByTokenAuthorisation(org.acegisecurity.acls.Permission permission) |
boolean |
isSystemAdmin(String username)
Returns true if the user is a sysadmin, false if not
|
protected org.acegisecurity.acls.Acl |
readAclById(org.acegisecurity.acls.objectidentity.ObjectIdentity identity) |
void |
setAclService(org.acegisecurity.acls.MutableAclService aclService) |
void |
setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor) |
void |
setCachedPlanManager(CachedPlanManager cachedPlanManager) |
void |
setObjectIdentityRetrievalStrategy(org.acegisecurity.acls.objectidentity.ObjectIdentityRetrievalStrategy objectIdentityRetrievalStrategy) |
void |
setOverrideAuthorities(org.acegisecurity.GrantedAuthority[] overrideAuthorities) |
void |
setProjectManager(ProjectManager projectManager) |
void |
setSidRetrievalStrategy(org.acegisecurity.acls.sid.SidRetrievalStrategy sidRetrievalStrategy) |
public boolean hasPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull Object object, @Nullable org.acegisecurity.Authentication authentication)
BambooPermissionManager
hasPermission
in interface BambooPermissionManager
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 permissionprotected boolean isPermissionSuppressedByTokenAuthorisation(@NotNull org.acegisecurity.acls.Permission permission)
public com.google.common.base.Predicate<Object> hasPermission(@NotNull BambooPermission permission, @Nullable org.acegisecurity.Authentication authentication)
BambooPermissionManager
hasPermission
in interface BambooPermissionManager
permission
- the permission to check forauthentication
- the authentication/principal whose secure identities will be checked for the permissionpublic boolean hasPermissionForAuthority(@NotNull org.acegisecurity.acls.Permission permission, @NotNull Object object, @NotNull org.acegisecurity.GrantedAuthority authority)
BambooPermissionManager
hasPermissionForAuthority
in interface BambooPermissionManager
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 permissionpublic org.acegisecurity.acls.Acl getAcl(@NotNull Object object)
getAcl
in interface BambooPermissionManager
protected org.acegisecurity.acls.Acl readAclById(org.acegisecurity.acls.objectidentity.ObjectIdentity identity)
public boolean hasPermission(@NotNull String username, @NotNull org.acegisecurity.acls.Permission permission, @NotNull Object object)
hasPermission
in interface BambooPermissionManager
public boolean hasPlanPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull PlanKey planKey)
BambooPermissionManager
hasPlanPermission
in interface BambooPermissionManager
permission
- permission to checkplanKey
- key of the planpublic boolean hasPlanPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull ImmutablePlan plan)
BambooPermissionManager
hasPlanPermission
in interface BambooPermissionManager
permission
- permission to checkplan
- planpublic boolean hasProjectPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull String projectKey)
BambooPermissionManager
permission
for a project identified by projectKey
.hasProjectPermission
in interface BambooPermissionManager
permission
- permission to checkprojectKey
- key of the project to checkpublic boolean hasProjectPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull Project project)
BambooPermissionManager
permission
for a project
.hasProjectPermission
in interface BambooPermissionManager
permission
- permission to checkproject
- project to checkpublic boolean canCreatePlanInProject(@NotNull String projectKey)
BambooPermissionManager
projectKey
.canCreatePlanInProject
in interface BambooPermissionManager
projectKey
- key of the project to checkpublic boolean canCreatePlanInProject(@NotNull Project project)
BambooPermissionManager
project
.canCreatePlanInProject
in interface BambooPermissionManager
project
- project to checkpublic boolean canCreateProject()
BambooPermissionManager
canCreateProject
in interface BambooPermissionManager
public boolean canCreatePlan()
BambooPermissionManager
This method might be expensive to compute as it may need to check permissions on all projects for this Bamboo instance.
canCreatePlan
in interface BambooPermissionManager
public boolean canCreateDeploymentProject()
canCreateDeploymentProject
in interface BambooPermissionManager
public boolean hasGlobalPermission(@NotNull org.acegisecurity.acls.Permission permission)
hasGlobalPermission
in interface BambooPermissionManager
public Collection<org.acegisecurity.acls.Permission> getPermissionsForPlan(@NotNull PlanKey planKey)
getPermissionsForPlan
in interface BambooPermissionManager
public boolean hasProjectEditPermission(@Nullable Project project)
hasProjectEditPermission
in interface BambooPermissionManager
public boolean isEnableSignup()
isEnableSignup
in interface BambooPermissionManager
@NotNull public Collection<String> getAdminGroups()
BambooPermissionManager
getAdminGroups
in interface BambooPermissionManager
@NotNull public Collection<String> getRestrictedAdminGroups()
BambooPermissionManager
getRestrictedAdminGroups
in interface BambooPermissionManager
@NotNull public Collection<String> getUsePermissionGroups()
BambooPermissionManager
getUsePermissionGroups
in interface BambooPermissionManager
@NotNull public String getDefaultUsersGroup()
getDefaultUsersGroup
in interface BambooPermissionManager
@NotNull public Collection<String> getGroupsWithPermission(BambooPermission permission)
@NotNull public Collection<String> getAdminUsers()
BambooPermissionManager
getAdminUsers
in interface BambooPermissionManager
@NotNull public Collection<String> getRestrictedAdminUsers()
BambooPermissionManager
getRestrictedAdminUsers
in interface BambooPermissionManager
@NotNull public Collection<String> getUsePermissionUsers()
BambooPermissionManager
getUsePermissionUsers
in interface BambooPermissionManager
@NotNull public Collection<String> getUsersWithPermission(BambooPermission permission)
public boolean isAdmin(String username)
BambooPermissionManager
isAdmin
in interface BambooPermissionManager
username
- the userpublic boolean isSystemAdmin(String username)
BambooPermissionManager
isSystemAdmin
in interface BambooPermissionManager
username
- the userpublic boolean isAllowedToSetGlobalPermission(@NotNull org.acegisecurity.acls.Permission permission)
BambooPermissionManager
isAllowedToSetGlobalPermission
in interface BambooPermissionManager
permission
- permission to checkpublic boolean canManageElasticBamboo()
BambooPermissionManager
canManageElasticBamboo
in interface BambooPermissionManager
public boolean canManageAgents()
BambooPermissionManager
canManageAgents
in interface BambooPermissionManager
public boolean canRunCustomBuild(@NotNull PlanKey planKey)
canRunCustomBuild
in interface BambooPermissionManager
planKey
- key of the plan in questionprotected boolean hasPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull HibernateObjectIdentityImpl objectIdentity, @NotNull org.acegisecurity.Authentication authentication)
protected boolean hasPermission(@NotNull org.acegisecurity.acls.Permission permission, @NotNull org.acegisecurity.acls.objectidentity.ObjectIdentity objectIdentity, @NotNull org.acegisecurity.Authentication authentication)
protected org.acegisecurity.acls.objectidentity.ObjectIdentity createObjectIdentity(@NotNull Object object)
public void setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor)
public void setAclService(org.acegisecurity.acls.MutableAclService aclService)
public void setSidRetrievalStrategy(org.acegisecurity.acls.sid.SidRetrievalStrategy sidRetrievalStrategy)
public void setCachedPlanManager(CachedPlanManager cachedPlanManager)
public void setProjectManager(ProjectManager projectManager)
public void setOverrideAuthorities(org.acegisecurity.GrantedAuthority[] overrideAuthorities)
public void setObjectIdentityRetrievalStrategy(org.acegisecurity.acls.objectidentity.ObjectIdentityRetrievalStrategy objectIdentityRetrievalStrategy)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.