-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2407b8f
commit c50ba37
Showing
8 changed files
with
265 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Diff: | ||
$ref: diff.yaml | ||
Query: | ||
$ref: query.yaml | ||
Schema: | ||
$ref: schema.yaml | ||
x-metadata: | ||
$ref: x-metadata.yaml | ||
|
||
Activity: | ||
$ref: activity.yaml | ||
Collections: | ||
$ref: collections.yaml | ||
Extensions: | ||
$ref: extensions.yaml | ||
Fields: | ||
$ref: fields.yaml | ||
Files: | ||
$ref: files.yaml | ||
Flows: | ||
$ref: flows.yaml | ||
Folders: | ||
$ref: folders.yaml | ||
Operations: | ||
$ref: operations.yaml | ||
Permissions: | ||
$ref: permissions.yaml | ||
Presets: | ||
$ref: presets.yaml | ||
Relations: | ||
$ref: relations.yaml | ||
Revisions: | ||
$ref: revisions.yaml | ||
Roles: | ||
$ref: roles.yaml | ||
Settings: | ||
$ref: settings.yaml | ||
Users: | ||
$ref: users.yaml | ||
Versions: | ||
$ref: versions.yaml | ||
Webhooks: | ||
$ref: webhooks.yaml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
summary: Retrieve a Permission | ||
description: Retrieve a single permissions object by unique identifier. | ||
operationId: getPermission | ||
parameters: | ||
- "$ref": "../../../components/parameters.yaml#/Id" | ||
- "$ref": "../../../components/parameters.yaml#/Fields" | ||
- "$ref": "../../../components/parameters.yaml#/Meta" | ||
responses: | ||
"200": | ||
description: Successful request | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
data: | ||
"$ref": "../../../components/schemas/permissions.yaml" | ||
"401": | ||
"$ref": "../../../components/responses.yaml#/UnauthorizedError" | ||
"404": | ||
"$ref": "../../../components/responses.yaml#/NotFoundError" | ||
tags: | ||
- Permissions | ||
x-codeSamples: | ||
- label: Directus SDK | ||
lang: JavaScript | ||
source: | | ||
import { createDirectus, rest, readPermission } from '@directus/sdk'; | ||
const client = createDirectus('directus_project_url').with(rest()); | ||
const result = await client.request(readPermission(permission_id, query_object)); | ||
- label: GraphQL | ||
lang: GraphQL | ||
source: | | ||
GET /graphql/system | ||
type Query { | ||
permissions_by_id(id: ID!): directus_permissions | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
get: | ||
$ref: getPermission.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
summary: Create a Permission | ||
description: Create a new permission. | ||
operationId: createPermission | ||
parameters: | ||
- "$ref": "../../components/parameters.yaml#/Meta" | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
properties: | ||
collection: | ||
description: What collection this permission applies to. | ||
type: string | ||
example: customers | ||
comment: | ||
description: If the user can post comments. | ||
type: string | ||
enum: | ||
- none | ||
- create | ||
- update | ||
- full | ||
create: | ||
description: If the user can create items. | ||
type: string | ||
enum: | ||
- none | ||
- full | ||
delete: | ||
description: If the user can update items. | ||
type: string | ||
enum: | ||
- none | ||
- mine | ||
- role | ||
- full | ||
explain: | ||
description: | ||
If the user is required to leave a comment explaining | ||
what was changed. | ||
type: string | ||
enum: | ||
- none | ||
- create | ||
- update | ||
- always | ||
read: | ||
description: If the user can read items. | ||
type: string | ||
enum: | ||
- none | ||
- mine | ||
- role | ||
- full | ||
role: | ||
description: | ||
Unique identifier of the role this permission applies | ||
to. | ||
type: integer | ||
example: 3 | ||
read_field_blacklist: | ||
description: Explicitly denies read access for specific fields. | ||
type: array | ||
items: | ||
type: string | ||
example: | ||
- featured_image | ||
status: | ||
description: What status this permission applies to. | ||
type: string | ||
status_blacklist: | ||
description: Explicitly denies specific statuses to be used. | ||
type: array | ||
items: | ||
type: string | ||
update: | ||
description: If the user can update items. | ||
type: string | ||
enum: | ||
- none | ||
- mine | ||
- role | ||
- full | ||
write_field_blacklist: | ||
description: Explicitly denies write access for specific fields. | ||
type: array | ||
items: | ||
type: string | ||
type: object | ||
responses: | ||
"200": | ||
description: Successful request | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
data: | ||
"$ref": "../../components/schemas/Permissions.yaml" | ||
"401": | ||
"$ref": "../../components/responses.yaml#/UnauthorizedError" | ||
"404": | ||
"$ref": "../../components/responses.yaml#/NotFoundError" | ||
tags: | ||
- Permissions | ||
x-codeSamples: | ||
- label: Directus SDK | ||
lang: JavaScript | ||
source: | | ||
import { createDirectus, rest, createPermission } from '@directus/sdk'; | ||
const client = createDirectus('directus_project_url').with(rest()); | ||
const result = await client.request(createPermission(permission_object)); | ||
- label: GraphQL | ||
lang: GraphQL | ||
source: | | ||
POST /graphql/system | ||
type Mutation { | ||
create_permissions_item(data: create_directus_permissions_input!): directus_permissions | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
summary: List Permissions | ||
description: List all permissions. | ||
operationId: getPermissions | ||
parameters: | ||
- "$ref": "../../components/parameters.yaml#/Fields" | ||
- "$ref": "../../components/parameters.yaml#/Limit" | ||
- "$ref": "../../components/parameters.yaml#/Offset" | ||
- "$ref": "../../components/parameters.yaml#/Meta" | ||
- "$ref": "../../components/parameters.yaml#/Sort" | ||
- "$ref": "../../components/parameters.yaml#/Filter" | ||
- "$ref": "../../components/parameters.yaml#/Search" | ||
- "$ref": "../../components/parameters.yaml#/Page" | ||
responses: | ||
"200": | ||
description: Successful request | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
data: | ||
type: array | ||
items: | ||
"$ref": "../../components/schemas/permissions.yaml" | ||
meta: | ||
"$ref": "../../components/schemas/x-metadata.yaml" | ||
"401": | ||
"$ref": "../../components/responses.yaml#/UnauthorizedError" | ||
"404": | ||
"$ref": "../../components/responses.yaml#/NotFoundError" | ||
tags: | ||
- Permissions | ||
x-codeSamples: | ||
- label: Directus SDK | ||
lang: JavaScript | ||
source: | | ||
import { createDirectus, rest, readPermissions } from '@directus/sdk'; | ||
const client = createDirectus('directus_project_url').with(rest()); | ||
const result = await client.request(readPermissions(query_object)); | ||
- label: GraphQL | ||
lang: GraphQL | ||
source: | | ||
POST /graphql/system | ||
type Query { | ||
permissions: directus_permissions | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
get: | ||
$ref: getPermissions.yaml | ||
post: | ||
$ref: createPermission.yaml |