๐Ÿ“ฆ directus / v6-archive

๐Ÿ“„ get-table-privileges.md ยท 59 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59# Get Table Privileges

> **Note:** Table names are case-sensitive
> **Note:**: Only admin has permission to access this endpoint

<span class="request">`GET` **/api/1.1/privileges/_[group-id]_/_[table-name]_**</span>

<span class="description">Get the table privileges for a specific user group</span>

<span class="arguments">Name</span> | Value | Description
------------------ | ----- | -----------
**group-id** _Integer_  |  <span class="required">Required</span>  |  The group `id` you wish to get the privileges from
**table-name** _String_  |  <span class="required">Required</span>  |  The table name you wish to get the privileges from

### Example Request

```bash
$ curl https://instance--key.directus.io/api/1.1/privileges/1/projects \
  -u [user-token]:
```

```javascript
client.getTablePrivileges(1, 'projects');
```

## Response

Table privilege for the specified table and user-group.

<span class="attributes">Attribute</span> | Description
-------|------------
**meta** _Meta Object_ | The Directus system metadata object that provides useful information not contained within the dataset itself [**Meta Object**: View Nested Attributes](/overview/objects-model.md#meta-object)
<span class="custom">**data**</span> _Privilege Object_ | <span class="custom">This data and its architecture is based on Directus Privileges's schema</span> [**Privilege Object**: View Nested Attributes](/overview/objects-model.md#privilege-object)

### Example Response

```json
{
  "meta": {
    "type": "item",
    "table": "directus_privileges"
  },
  "data": {
    "id": 1,
    "table_name": "projects",
    "group_id": 1,
    "read_field_blacklist": null,
    "write_field_blacklist": null,
    "nav_listed": 1,
    "status_id": 0,
    "allow_view": 2,
    "allow_add": 1,
    "allow_edit": 2,
    "allow_delete": 2,
    "allow_alter": 1
  }
}
```