Skip to main content
The resourcerestrictions client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.
Restricting a resource prevents roles bound at higher hierarchy levels (space, org, account) from granting access to it. Only space admins or users with the PROJECT_RESTRICT permission can perform these actions. Currently only PROJECT resources are supported.

List Resource Restrictions

List returns a paginated list of resource restrictions. Defaults to a page size of 50. ResourceType, when non-empty, filters to a single resource type (currently only PROJECT is supported); when empty, restrictions of all supported types are returned. Signature:
Usage Example:

Restrict a Resource

Restrict marks a resource as restricted and returns the restriction record. This operation is idempotent — restricting an already-restricted resource returns the existing restriction without error. Signature:
Usage Example:

Unrestrict a Resource

Unrestrict removes a restriction from a resource. ResourceID is the ID of the restricted resource (e.g. a project ID), not the ID of the restriction record itself — the API dereferences from the restricted resource to the restriction it holds. It returns only an error. Signature:
Usage Example: