> For the complete documentation index, see [llms.txt](https://docs.acpt.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acpt.io/custom-content-types/permissions.md).

# Permissions

Control which WordPress roles can read, create, update, or delete CCT records.

ACPT's CCT permission system lets you restrict access to custom tables and table groups on a per-role basis. Permissions are configured through the ACPT **Permissions Manager** and applied automatically to WordPress roles on `admin_init`.

## Default behaviour

When no permissions are configured for a table or table group, **all logged-in users** can read, create, update, and delete records. Permissions are opt-in — you only need to configure them if you want to restrict access.

## Table permissions

Each table supports four capabilities:

| Capability | Description                                   |
| ---------- | --------------------------------------------- |
| **read**   | View the records list and individual records. |
| **create** | Create new records.                           |
| **update** | Edit existing records.                        |
| **delete** | Delete records.                               |

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-45ef115ab0d16177539e2711eec71308a1084be4%2Fcct-table-permissions.png?alt=media" alt="Table permissions screen"><figcaption><p>Granting the Editor role read/create access on the movies table.</p></figcaption></figure>

## Table Group permissions

Each table group supports two capabilities:

| Capability | Description                                                            |
| ---------- | ---------------------------------------------------------------------- |
| **read**   | View the group and its tables in context (e.g. on a post edit screen). |
| **edit**   | Edit the table group settings.                                         |

## Configuring permissions

1. Navigate to **ACPT → Custom Content Types → \[table or group name]** and click **View**.
2. Click **Permissions** in the action buttons.
3. For each WordPress role, toggle the capabilities on or off.
4. Click **Save**.

Alternatively, navigate directly to **ACPT → Permissions Manager → Custom Content Types**.

## How capabilities are applied

ACPT translates each capability into a WordPress role capability using the pattern:

```
{capability}_{tableName}
```

Examples for a table named `movies`:

| ACPT capability | WordPress capability |
| --------------- | -------------------- |
| read            | `read_movies`        |
| create          | `create_movies`      |
| update          | `update_movies`      |
| delete          | `delete_movies`      |

These capabilities are added to (or removed from) WordPress roles via `$role->add_cap()` / `$role->remove_cap()` on every `admin_init`.

## Checking permissions in templates

```php
if (current_user_can('read_movies')) {
    // show movies list
}

if (current_user_can('create_movies')) {
    // show create record button
}
```

## See also

* [Permissions Manager](/permissions-manager/custom-content-types.md)
* [Table Groups](/custom-content-types/table-groups.md)
* [Tables](/custom-content-types/tables.md)
