def list(slug, limit: nil, offset: nil, timeout: nil)def list: (
String slug,
?limit: Integer?,
?offset: Integer?,
?timeout: seconds?
) -> ProductAccessPageReads one page of the explicit member grants recorded on a product. The returned page adds private? 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 array on a public product still means every workspace member can read it. The grant list only becomes an access control list once private? 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 nil 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
require "envless/sdk"
page = Envless.products.access.list("billing")
puts "#{page.private?} #{page.pagination[:totalCount]}"
page.items.each do |entry|
puts "#{entry[:id]} #{entry.dig(:user, :email)}"
endParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | String | Yes | Product slug, or the product uniqueId when the value is UUID shaped. |
limit: | Integer | No | Rows per page, a whole number from 1 to 100. |
offset: | Integer | No | Rows to skip, a whole number of 0 or greater. |
timeout: | Integer | Float | Rational | No | Seconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
Envless::ProductAccessPage with items, pagination and the private? flag of the product.
Reads the access collection. list returns one page as an Envless::ProductAccessPage with items and pagination, list_all collects every page into an array, and iterate yields one item at a time to a block, fetching the next page only when it gets there. Without a block, iterate returns an Enumerator.
Worth knowing
- The response collection key is
access, so a raw HTTP caller readsdata.accesswhere the SDK exposesitems.
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.