Skip to content

Commit 62a0a09

Browse files
committed
document enable/disable endpoints for documents and users
1 parent 0fe3df4 commit 62a0a09

File tree

2 files changed

+125
-4
lines changed

2 files changed

+125
-4
lines changed

api/grist.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,55 @@ paths:
365365
responses:
366366
200:
367367
description: "Success"
368+
/docs/{docId}/disable:
369+
post:
370+
operationId: disableDoc
371+
tags:
372+
- docs
373+
summary: "Disable a document."
374+
description: |
375+
Disabled documents cannot be accessed or modified. Moving and
376+
renaming a disabled doc is also forbidden, as well as
377+
accessing or submitting published forms associated to a
378+
disabled document.
368379
380+
Disabled documents, however, can be moved to and restored from
381+
the trash.
382+
383+
The operation is non-destructive. Disabled documents can be
384+
re-enabled.
385+
386+
Only admin accounts can disable a document.
387+
parameters:
388+
- $ref: '#/components/parameters/docIdPathParam'
389+
responses:
390+
200:
391+
description: "Success"
392+
403:
393+
description: "The caller is not allowed to disable this document"
394+
404:
395+
description: "The document is not found"
396+
/docs/{docId}/enable:
397+
post:
398+
operationId: enableDoc
399+
tags:
400+
- docs
401+
summary: "Enable a document."
402+
description: |
403+
If a document has been previously disabled, this will restore
404+
all former access to a document, including access to its
405+
associated published forms.
406+
407+
Only admin accounts can enable a document.
408+
parameters:
409+
- $ref: '#/components/parameters/docIdPathParam'
410+
responses:
411+
200:
412+
description: "Success"
413+
403:
414+
description: "The caller is not allowed to enable this document"
415+
404:
416+
description: "The document is not found"
369417
/docs/{docId}/copy:
370418
post:
371419
operationId: copyDoc
@@ -1446,6 +1494,44 @@ paths:
14461494
description: "The caller is not allowed to delete this account"
14471495
404:
14481496
description: "The user is not found"
1497+
/users/{userId}/disable:
1498+
post:
1499+
tags:
1500+
- users
1501+
summary: "Disable a user"
1502+
description: |
1503+
A disabled user can not log in and loses access to all pages,
1504+
including public ones, as well as API access. The operation is
1505+
non-destructive. Disabled users can be re-enabled.
1506+
1507+
Only admin accounts can disable a user.
1508+
parameters:
1509+
- $ref: '#/components/parameters/userIdPathParam'
1510+
responses:
1511+
200:
1512+
description: "The account has been disabled successfully"
1513+
403:
1514+
description: "The caller is not allowed to disable this account"
1515+
404:
1516+
description: "The user is not found"
1517+
/users/{userId}/enable:
1518+
post:
1519+
tags:
1520+
- users
1521+
summary: "Enable a user"
1522+
description: |
1523+
If a user has been disabled, this will restore their access, including API access.
1524+
1525+
Only admin accounts can enable a user.
1526+
parameters:
1527+
- $ref: '#/components/parameters/userIdPathParam'
1528+
responses:
1529+
200:
1530+
description: "The account has been enabled successfully"
1531+
403:
1532+
description: "The caller is not allowed to enable this account"
1533+
404:
1534+
description: "The user is not found"
14491535
/service-accounts:
14501536
get:
14511537
tags:

0 commit comments

Comments
 (0)