Class PermissionsControl

    • Constructor Detail

      • PermissionsControl

        public PermissionsControl​(@NotNull
                                  @NotNull BambooEnvironmentData environmentData)
    • Method Detail

      • grantProjectPermission

        public void grantProjectPermission​(@NotNull
                                           @NotNull String projectKey,
                                           @NotNull
                                           @NotNull BambooTestPermission permission)
        Grant project permission
        Parameters:
        projectKey - key of a Project
        permission - permission to grant
      • revokeProjectPermission

        public void revokeProjectPermission​(@NotNull
                                            @NotNull String projectKey,
                                            @NotNull
                                            @NotNull BambooTestPermission permission)
        Revoke project permission
        Parameters:
        projectKey - key of a Project
        permission - permission to revoke
      • grantProjectPlanPermission

        public void grantProjectPlanPermission​(@NotNull
                                               @NotNull String projectKey,
                                               @NotNull
                                               @NotNull BambooTestPermission permission)
        Grant project plan permission
        Parameters:
        projectKey - key of a Project
        permission - permission to grant
      • setPlanPermissions

        public void setPlanPermissions​(@NotNull
                                       @NotNull com.atlassian.bamboo.specs.api.builders.permission.PlanPermissions permissions)
        Set complete plan permissions
        Parameters:
        permissions - new plan permission scheme
      • setPlanPermissions

        public void setPlanPermissions​(@NotNull
                                       @NotNull PlanKey planKey,
                                       @NotNull
                                       @NotNull com.atlassian.bamboo.specs.api.builders.permission.Permissions permissions)
        Set complete plan permissions
        Parameters:
        planKey - key of a Plan
        permissions - new plan permission scheme
      • hasPlanPermission

        public boolean hasPlanPermission​(@NotNull
                                         @NotNull PlanKey planKey,
                                         @NotNull
                                         @NotNull BambooTestPermission permission)
      • hasDeploymentProjectPermission

        public boolean hasDeploymentProjectPermission​(long deploymentProjectId,
                                                      @NotNull
                                                      @NotNull BambooTestPermission permission)
      • grantLinkedRepositoryPermission

        public void grantLinkedRepositoryPermission​(long repositoryId,
                                                    @NotNull
                                                    @NotNull BambooTestPermission permission)
        Grant permission to a linked repository.
        Parameters:
        repositoryId - id of repository
        permission - permission to grant
      • revokeLinkedRepositoryPermission

        public void revokeLinkedRepositoryPermission​(long repositoryId,
                                                     @NotNull
                                                     @NotNull BambooTestPermission permission)
        Revoke permission to a linked repository.
        Parameters:
        repositoryId - id of repository
        permission - permission to revoke
      • hasLinkedRepositoryPermission

        public boolean hasLinkedRepositoryPermission​(long repositoryId,
                                                     @NotNull
                                                     @NotNull BambooTestPermission permission)
        Check whether a permission is granted on a linked repository.
        Parameters:
        repositoryId - id of repository
        permission - permission to check
      • setDeploymentProjectPermissions

        public void setDeploymentProjectPermissions​(@NotNull
                                                    @NotNull String deploymentProjectName,
                                                    @NotNull
                                                    @NotNull com.atlassian.bamboo.specs.api.builders.permission.Permissions permissions)
        Sets deployment project permissions
        Parameters:
        deploymentProjectName - deployment project name
        permissions - new permission set
      • setEnvironmentPermissions

        public void setEnvironmentPermissions​(@NotNull
                                              @NotNull String deploymentProjectName,
                                              @NotNull
                                              @NotNull String environmentName,
                                              @NotNull
                                              @NotNull com.atlassian.bamboo.specs.api.builders.permission.Permissions permissions)
        Sets deployment environment permissions
        Parameters:
        deploymentProjectName - deployment project name
        environmentName - environment name
        permissions - new permission set