Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openapi/components/schemas/_index.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
x-metadata:
$ref: x-metadata.yaml
Access:
$ref: access.yaml
Activity:
$ref: activity.yaml
Collections:
Expand Down
36 changes: 36 additions & 0 deletions openapi/components/schemas/access.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
type: object
properties:
id:
description: Primary key of the access rule.
example: 8cbb43fe-4cdf-4991-8352-c461779cec02
type: string
format: uuid
role:
description: The role this access rule applies to. Nullable if the rule applies directly to a user. Many-to-one to roles.
example: 8b4474c0-288d-4bb8-b62e-8330646bb6aa
nullable: true
oneOf:
- type: string
format: uuid
- $ref: roles.yaml
user:
description: The user this access rule applies to. Nullable if the rule applies to a role. Many-to-one to users.
example: 0bc7b36a-9ba9-4ce0-83f0-0a526f354e07
nullable: true
oneOf:
- type: string
format: uuid
- $ref: users.yaml
policy:
description: The policy associated with this access rule. Many-to-one to policies.
example: 22640672-eef0-4ee9-ab04-591f3afb2886
oneOf:
- type: string
format: uuid
- $ref: policies.yaml
sort:
description: Sort order of this access rule.
example: 1
nullable: true
type: integer
x-collection: directus_access
9 changes: 9 additions & 0 deletions openapi/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ servers:
description: Your current Directus project.

paths:
"/access":
$ref: paths/access/index.yaml
"/access‎":
$ref: paths/access/singular/index.yaml
"/access/{id}":
$ref: paths/access/_id/index.yaml
"/activity":
$ref: paths/activity/index.yaml
"/activity/{id}":
Expand Down Expand Up @@ -240,6 +246,9 @@ components:
$ref: components/schemas/_index.yaml
security: []
tags:
- name: Access
description: Access rules define which policies are assigned to a role or user. They are the junction between policies and the roles or users they apply to.
x-collection: directus_access
- name: Activity
description: All events that happen within Directus are tracked and stored in the activities collection. This gives you full accountability over everything that happens.
x-collection: directus_activity
Expand Down
24 changes: 24 additions & 0 deletions openapi/paths/access/_id/deleteAccessRule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
summary: Delete an Access Rule
description: Delete an existing access rule.
operationId: deleteAccessRule
responses:
'204':
description: The resource was deleted successfully.
'401':
$ref: ../../../components/responses.yaml#/UnauthorizedError
'404':
$ref: ../../../components/responses.yaml#/NotFoundError
security: []
tags:
- Access
parameters:
- $ref: ../../../components/parameters.yaml#/UUId
x-codeSamples:
- label: Directus SDK
lang: JavaScript
source: |
// Not supported in Directus SDK
- label: GraphQL
lang: GraphQL
source: |
// Not supported in GraphQL
33 changes: 33 additions & 0 deletions openapi/paths/access/_id/getAccessRule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
summary: Retrieve an Access Rule
description: Retrieve a single access rule by unique identifier.
operationId: getAccessRule
parameters:
- $ref: ../../../components/parameters.yaml#/UUId
- $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/access.yaml
'401':
$ref: ../../../components/responses.yaml#/UnauthorizedError
'404':
$ref: ../../../components/responses.yaml#/NotFoundError
security: []
tags:
- Access
x-codeSamples:
- label: Directus SDK
lang: JavaScript
source: |
// Not supported in Directus SDK
- label: GraphQL
lang: GraphQL
source: |
// Not supported in GraphQL
6 changes: 6 additions & 0 deletions openapi/paths/access/_id/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
get:
$ref: getAccessRule.yaml
patch:
$ref: updateAccessRule.yaml
delete:
$ref: deleteAccessRule.yaml
57 changes: 57 additions & 0 deletions openapi/paths/access/_id/updateAccessRule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
summary: Update an Access Rule
description: Update an existing access rule.
operationId: updateAccessRule
parameters:
- $ref: ../../../components/parameters.yaml#/UUId
- $ref: ../../../components/parameters.yaml#/Fields
- $ref: ../../../components/parameters.yaml#/Meta
requestBody:
content:
application/json:
schema:
type: object
properties:
role:
type: string
format: uuid
nullable: true
description: The role this access rule applies to.
user:
type: string
format: uuid
nullable: true
description: The user this access rule applies to.
policy:
type: string
format: uuid
description: The policy associated with this access rule.
sort:
type: integer
nullable: true
description: Sort order of this access rule.
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
properties:
data:
$ref: ../../../components/schemas/access.yaml
'401':
$ref: ../../../components/responses.yaml#/UnauthorizedError
'404':
$ref: ../../../components/responses.yaml#/NotFoundError
security: []
tags:
- Access
x-codeSamples:
- label: Directus SDK
lang: JavaScript
source: |
// Not supported in Directus SDK
- label: GraphQL
lang: GraphQL
source: |
// Not supported in GraphQL
51 changes: 51 additions & 0 deletions openapi/paths/access/createAccessRules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
summary: Create Multiple Access Rules
description: Create multiple new access rules.
operationId: createAccessRules
parameters:
- $ref: ../../components/parameters.yaml#/Fields
- $ref: ../../components/parameters.yaml#/Limit
- $ref: ../../components/parameters.yaml#/Meta
- $ref: ../../components/parameters.yaml#/Offset
- $ref: ../../components/parameters.yaml#/Sort
- $ref: ../../components/parameters.yaml#/Filter
- $ref: ../../components/parameters.yaml#/Search
requestBody:
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: ../../components/schemas/access.yaml
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: ../../components/schemas/access.yaml
meta:
$ref: ../../components/schemas/x-metadata.yaml
'401':
$ref: ../../components/responses.yaml#/UnauthorizedError
'404':
$ref: ../../components/responses.yaml#/NotFoundError
security: []
tags:
- Access
x-codeSamples:
- label: Directus SDK
lang: JavaScript
source: |
// Not supported in Directus SDK
- label: GraphQL
lang: GraphQL
source: |
// Not supported in GraphQL
28 changes: 28 additions & 0 deletions openapi/paths/access/deleteAccessRules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
summary: Delete Multiple Access Rules
description: Delete multiple existing access rules.
operationId: deleteAccessRules
requestBody:
description: An array of access rule primary keys.
content:
application/json:
schema:
type: array
items:
type: string
responses:
'204':
description: The resource was deleted successfully.
'401':
$ref: ../../components/responses.yaml#/UnauthorizedError
security: []
tags:
- Access
x-codeSamples:
- label: Directus SDK
lang: JavaScript
source: |
// Not supported in Directus SDK
- label: GraphQL
lang: GraphQL
source: |
// Not supported in GraphQL
42 changes: 42 additions & 0 deletions openapi/paths/access/getAccessRules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
summary: List Access Rules
description: List all access rules that exist in Directus.
operationId: getAccessRules
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/access.yaml
meta:
$ref: ../../components/schemas/x-metadata.yaml
'401':
$ref: ../../components/responses.yaml#/UnauthorizedError
'404':
$ref: ../../components/responses.yaml#/NotFoundError
security: []
tags:
- Access
x-codeSamples:
- label: Directus SDK
lang: JavaScript
source: |
// Not supported in Directus SDK
- label: GraphQL
lang: GraphQL
source: |
// Not supported in GraphQL
8 changes: 8 additions & 0 deletions openapi/paths/access/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
get:
$ref: getAccessRules.yaml
post:
$ref: createAccessRules.yaml
patch:
$ref: updateAccessRules.yaml
delete:
$ref: deleteAccessRules.yaml
55 changes: 55 additions & 0 deletions openapi/paths/access/singular/createAccessRule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
summary: Create an Access Rule
description: Create a new access rule.
operationId: createAccessRule
parameters:
- $ref: ../../../components/parameters.yaml#/Fields
- $ref: ../../../components/parameters.yaml#/Meta
requestBody:
content:
application/json:
schema:
type: object
properties:
role:
type: string
format: uuid
nullable: true
description: The role this access rule applies to.
user:
type: string
format: uuid
nullable: true
description: The user this access rule applies to.
policy:
type: string
format: uuid
description: The policy associated with this access rule.
sort:
type: integer
nullable: true
description: Sort order of this access rule.
responses:
'200':
description: Successful request
content:
application/json:
schema:
type: object
properties:
data:
$ref: ../../../components/schemas/access.yaml
'401':
$ref: ../../../components/responses.yaml#/UnauthorizedError
'404':
$ref: ../../../components/responses.yaml#/NotFoundError
tags:
- Access
x-codeSamples:
- label: Directus SDK
lang: JavaScript
source: |
// Not supported in Directus SDK
- label: GraphQL
lang: GraphQL
source: |
// Not supported in GraphQL
2 changes: 2 additions & 0 deletions openapi/paths/access/singular/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
post:
$ref: createAccessRule.yaml
Loading