---
sidebar:
  label: roboto.auth.record_access
  order: 2
title: roboto.auth.record_access
---
## Module Contents

### AccessGrant

```python
class roboto.auth.record_access.AccessGrant(/, **data: Any)
```

`from roboto.auth import AccessGrant`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L97-L109)

Bases: `pydantic.BaseModel`

One grant on a record: a subject and the role it holds there.

**Usage**

```python
from roboto.auth import AccessGrant, AccessRole, AccessSubject
grant = AccessGrant(subject=AccessSubject.user("ben@example.com"), role=AccessRole.Viewer)
```

**Parameters**

- **data** (`Any`)

**Attributes**

- **AccessGrant.role** (`AccessRole`): What the grant lets the subject do.
- **AccessGrant.subject** (`AccessSubject`): Whom the grant names.

### AccessRole

```python
class roboto.auth.record_access.AccessRole
```

`from roboto.auth import AccessRole`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L30-L44)

Bases: `str`, `enum.Enum`

What a grant lets its subject do with a record. Each role includes the ones before it: an editor may do everything a viewer may, and a deleter everything an editor may.

**Attributes**

- **AccessRole.Deleter** = `'deleter'`: On a dataset or collection, everything an editor may do, and delete the record. On a View, only what an editor may do, since only a View's author and its organization's owners may delete it; a View takes no new `deleter` grant.
- **AccessRole.Editor** = `'editor'`: Read and change the record, and add or remove its grants. On a dataset or collection, an editor may also set whether the record is restricted; on a View, only the View's author and the organization's owners may.
- **AccessRole.Viewer** = `'viewer'`: Read the record.

### AccessSubject

```python
class roboto.auth.record_access.AccessSubject(/, **data: Any)
```

`from roboto.auth import AccessSubject`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L47-L94)

Bases: `pydantic.BaseModel`

Whom a grant on a record names.

Serialized without `id` when `id` is `None`, as an [`AccessSubjectKind.Everyone`](/docs/reference/python-sdk/roboto/auth/record_access#roboto.auth.record_access.AccessSubjectKind.Everyone) subject is.

**Usage**

```python
from roboto.auth import AccessSubject
AccessSubject.user("ben@example.com").model_dump(mode="json")
# {'kind': 'user', 'id': 'ben@example.com'}
AccessSubject.everyone().model_dump(mode="json")
# {'kind': 'everyone'}
```

**Parameters**

- **data** (`Any`)

**Attributes**

- **AccessSubject.id** (`str | None`) = `None`: The user ID, group ID or org ID the subject names; `None` for [`AccessSubjectKind.Everyone`](/docs/reference/python-sdk/roboto/auth/record_access#roboto.auth.record_access.AccessSubjectKind.Everyone).
- **AccessSubject.kind** (`AccessSubjectKind`): What the subject is.

#### AccessSubject.everyone()

```python
@classmethod
def everyone() -> AccessSubject
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L85-L87)

Return the subject naming every signed-in Roboto user.

**Returns**

- `AccessSubject`

#### AccessSubject.group()

```python
@classmethod
def group(group_id: str) -> AccessSubject
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L72-L74)

Return the subject naming every member of the group with ID `group_id`.

**Parameters**

- **group_id** (`str`)

**Returns**

- `AccessSubject`

#### AccessSubject.org_members()

```python
@classmethod
def org_members(org_id: str) -> AccessSubject
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L77-L82)

Return the subject naming every member of the organization with ID `org_id`.

A grant to it may be added only on a record of that organization.

**Parameters**

- **org_id** (`str`)

**Returns**

- `AccessSubject`

#### AccessSubject.user()

```python
@classmethod
def user(user_id: str) -> AccessSubject
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L67-L69)

Return the subject naming the person with ID `user_id`.

**Parameters**

- **user_id** (`str`)

**Returns**

- `AccessSubject`

### AccessSubjectKind

```python
class roboto.auth.record_access.AccessSubjectKind
```

`from roboto.auth import AccessSubjectKind`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L13-L27)

Bases: `str`, `enum.Enum`

Whom a grant on a record names.

**Attributes**

- **AccessSubjectKind.Everyone** = `'everyone'`: Every signed-in Roboto user. Takes no ID, and may hold only [`AccessRole.Viewer`](/docs/reference/python-sdk/roboto/auth/record_access#roboto.auth.record_access.AccessRole.Viewer).
- **AccessSubjectKind.Group** = `'group'`: Every member of one group, named by group ID.
- **AccessSubjectKind.OrgMembers** = `'org_members'`: Every member of one organization, named by org ID. A grant to it may be added only on a record of that organization.
- **AccessSubjectKind.User** = `'user'`: One person, named by user ID.

### EditRecordAccessRequest

```python
class roboto.auth.record_access.EditRecordAccessRequest(/, **data: Any)
```

`from roboto.auth import EditRecordAccessRequest`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L129-L148)

Bases: `pydantic.BaseModel`

Request body of `PUT` on a dataset's, collection's or View's `access` route from API version 2026-11-19.

The change is applied whole or not at all: grants in `add` are added, then grants in `remove` are removed, then the record's restriction is set when `restricted` is given. A request that changes nothing returns who the record is shared with, and needs only permission to read the record.

**Parameters**

- **data** (`Any`)

**Attributes**

- **EditRecordAccessRequest.add** (`list[AccessGrant]`) = `None`: Grants to add. A grant to [`AccessSubjectKind.OrgMembers`](/docs/reference/python-sdk/roboto/auth/record_access#roboto.auth.record_access.AccessSubjectKind.OrgMembers) may name only the record's own organization, [`AccessSubjectKind.Everyone`](/docs/reference/python-sdk/roboto/auth/record_access#roboto.auth.record_access.AccessSubjectKind.Everyone) may be given only [`AccessRole.Viewer`](/docs/reference/python-sdk/roboto/auth/record_access#roboto.auth.record_access.AccessRole.Viewer), and a View takes no new [`AccessRole.Deleter`](/docs/reference/python-sdk/roboto/auth/record_access#roboto.auth.record_access.AccessRole.Deleter) grant.
- **EditRecordAccessRequest.remove** (`list[AccessGrant]`) = `None`: Grants to remove, including one that `add` would refuse, such as a grant to another organization's members. Removing a grant the record does not hold changes nothing.
- **EditRecordAccessRequest.restricted** (`bool | None`) = `None`: `True` makes members of the record's organization need a grant to reach it; `False` lets every member reach it; `None` leaves it as it is. On a View, only the View's author and its organization's owners may set it.

### RecordAccessResponse

```python
class roboto.auth.record_access.RecordAccessResponse(/, **data: Any)
```

`from roboto.auth import RecordAccessResponse`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/auth/record_access.py#L112-L126)

Bases: `pydantic.BaseModel`

Who a dataset, collection or View is shared with: the response of `GET` and `PUT` on its `access` route (`/v1/datasets/<dataset_id>/access`, `/v1/collections/<collection_id>/access`, `/v1/views/id/<view_id>/access`) from API version 2026-11-19.

**Parameters**

- **data** (`Any`)

**Attributes**

- **RecordAccessResponse.grants** (`list[AccessGrant]`) = `None`: The record's grants, ordered by subject kind, subject ID and role.

- **RecordAccessResponse.restricted** (`bool`): Whether members of the record's organization need a grant to reach it. While a dataset or collection is unrestricted, every member of its organization may read, change, share and delete it; while a View is unrestricted, every member may read it. The organization's owners, and a View's author, reach the record either way.

  Datasets and collections start unrestricted. A View starts restricted unless it is created with [`Organization`](/docs/reference/python-sdk/roboto/domain/views/record#roboto.domain.views.record.ViewVisibility.Organization) visibility.
