def list(
slug: str,
*,
limit: int | None = None,
offset: int | None = None,
timeout: float | None = None,
) -> ProductAccessPageasync def list(
slug: str,
*,
limit: int | None = None,
offset: int | None = None,
timeout: float | None = None,
) -> ProductAccessPageReads one page of the explicit member grants recorded on a product. The returned page adds isPrivate alongside items and pagination, and the two have to be read together: grants are stored whether or not the product is private, so an empty items list on a public product still means every workspace member can read it. The grant list only becomes an access control list once isPrivate is True.
items[i]['id'] is the workspace member id, the same id space the grant and revoke calls take, not the user id. The user id sits on items[i]['user']['id'], and user is None when no user record is attached to the membership. Entries are ordered by when each member joined the workspace, oldest first, then paginated in memory.
Example
from envless import envless
page = envless.products.access.list('billing')
print(page['isPrivate'], page['pagination']['totalCount'])
for entry in page['items']:
user = entry['user']
print(entry['id'], user['email'] if user else None)import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
page = await envless.products.access.list('billing')
print(page['isPrivate'], page['pagination']['totalCount'])
for entry in page['items']:
user = entry['user']
print(entry['id'], user['email'] if user else None)
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | str | Yes | Product slug, or the product uniqueId when the value is UUID shaped. |
limit | int | No | Rows per page, a whole number from 1 to 100. |
offset | int | No | Rows to skip, a whole number of 0 or greater. |
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
ProductAccessPage with items, pagination and the product isPrivate flag.
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
- The response collection key is
access, soraw.requestreturns the rows under'access'where the methods exposeitems.
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.list()
The same method in @goenvless/sdk, with the same request, retries and errors.