def list_permissions(
*,
timeout: float | None = None,
) -> PermissionsResourceasync def list_permissions(
*,
timeout: float | None = None,
) -> PermissionsResourceReturns the complete catalogue of permission strings the platform understands, the same catalogue grouped by resource in byResource, and the exact permission lists behind owner, admin and viewer in systemRoles. Read it before create or update so you only ever send names that exist.
Filter on assignableToCustomRoles when you build a picker: the False entries, workspace:delete and billing:manage, are refused for every custom role regardless of who asks. The catalogue is only the outer ceiling, the caller permission check still applies on top of it, so a list that passes validation can still be rejected with 403.
This response is not a collection and takes no list options. The pagination middleware accepts limit and offset on the route, but they have no effect, which is why the method only takes timeout=.
Example
from envless import envless
catalogue = envless.roles.list_permissions()
assignable = [
permission
for permission in catalogue['permissions']
if permission['assignableToCustomRoles']
]
print(list(catalogue['byResource']))
print(len(assignable), len(catalogue['systemRoles']['owner']))import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
catalogue = await envless.roles.list_permissions()
assignable = [
permission
for permission in catalogue['permissions']
if permission['assignableToCustomRoles']
]
print(list(catalogue['byResource']))
print(len(assignable), len(catalogue['systemRoles']['owner']))
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
timeout | float | No | Seconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
PermissionsResource with the flat permissions list, the byResource index and the systemRoles sets.
Worth knowing
- The payload is static for a given API version, so fetch it once and cache it rather than calling it before every role edit.
byResourcekeys are the part of each permission string before the colon, sobyResource['variables']holdsvariables:readthroughvariables:delete.systemRoles['owner']is the entire catalogue, which makes it the quickest way to see everything the platform can grant.
Required scopes
roles:read
Underlying endpoint
GET /permissions
Request and response schema, every error code, and a live playground.
In TypeScript
envless.roles.listPermissions()
The same method in @goenvless/sdk, with the same request, retries and errors.