-
Type:
Suggestion
-
Resolution: Unresolved
-
Component/s: Pipelines - Deployments
-
None
-
1
Problem
With the recent introduction of granular deployment permissions (release notes), repository admins can grant individual users and groups permission to deploy to a specific environment. These permissions can only be managed through the UI, one environment at a time, in each repository's settings. The REST API has no endpoint for them, and the current endpoint exposes only restrictions.admin_only, with no representation of the user and group permission list, so the feature cannot be configured programmatically.
Proposed Solution
Provide REST endpoints to list, add and remove user and group permissions on a deployment environment, for example GET, POST and DELETE on /2.0/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}/permissions, and include the resulting permission list in the deployment environment object.
Use Case
Organizations that manage thousands of repositories need to apply a consistent deployment permission model across their estate, which is not practical to do by hand in the UI. API access would also let them keep environment permissions in sync with their infrastructure-as-code definitions and audit who can deploy to production without visiting each repository individually.