Products

envless.products.access.list_all()

Collect every member grant on a product

def list_all(
    slug: str,
    *,
    limit: int | None = None,
    offset: int | None = None,
    timeout: float | None = None,
) -> list[ProductAccessEntry]

Walks every page of the grants recorded on a product and returns one flat list of entries.

This drops the isPrivate flag that access.list returns, because it streams items only. Without that flag the grant list on its own says nothing about who can read the product, so call access.list once whenever the privacy state matters. An empty list means no grants are stored, not that nobody has access.

Example

from envless import envless

grants = envless.products.access.list_all('billing')

print([grant['id'] for grant in grants])

Parameters

ParameterTypeRequiredDescription
slugstrYesProduct slug, or the product uniqueId when the value is UUID shaped.
limitintNoPage size for each underlying request, capped at 100.
offsetintNoRow to start the walk from.
timeoutfloatNoSeconds 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

An list[ProductAccessEntry], each holding the workspace member id and a user summary.

Reads the access collection. list returns one page as a dict with items and pagination, list_all collects every page into a list, and iterate yields one item at a time, fetching the next page only when the loop reaches it. On AsyncEnvless, iterate is an async iterator for async for.

Worth knowing

  • Grant lists are small in practice, so this is usually the right variant, with access.list reserved for the privacy flag.

Required scopes

product-access:read

Underlying endpoint

GET /products/{slug}/access

Request and response schema, every error code, and a live playground.

In TypeScript

envless.products.access.listAll()

The same method in @goenvless/sdk, with the same request, retries and errors.