dh-remixer-sdk 0.0.45 → 0.0.46-13d9daa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -63,8 +63,9 @@ export const auth = {
|
|
|
63
63
|
/**
|
|
64
64
|
* Whether the signed-in user is a site admin of this project (granted by email in the editor,
|
|
65
65
|
* Users → Site admins). Site admins read every non-private record, add records to admin-only
|
|
66
|
-
* types
|
|
67
|
-
*
|
|
66
|
+
* types, update and delete any non-private record and change its owner fields; other signed-in
|
|
67
|
+
* users update and delete only the records they own. Anonymous visitors are never site admins, so
|
|
68
|
+
* no request is made for them. A grant or revocation takes effect within a minute.
|
|
68
69
|
*/
|
|
69
70
|
async isSiteAdmin(): Promise<boolean> {
|
|
70
71
|
const session = await getProjectSession();
|
|
@@ -11,13 +11,19 @@ export class RemixerRuntimeError extends Error {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Codes the runtime answers with a 403 when a data read or
|
|
15
|
-
* level (`entity_types.read_access` / `create_access`):
|
|
14
|
+
* Codes the runtime answers with a 403 when a data read or write is refused by the type's access
|
|
15
|
+
* level (`entity_types.read_access` / `create_access`) or its owner fields:
|
|
16
16
|
* - `sign_in_required`: the type needs a signed-in website user (or the read touched fields that are
|
|
17
17
|
* not public); sign the visitor in and retry.
|
|
18
18
|
* - `admin_required`: only a site admin may add records to this type.
|
|
19
|
-
* - `data_access_denied`: the type is private to the editor
|
|
20
|
-
*
|
|
19
|
+
* - `data_access_denied`: the type is private to the editor, so no site caller can read or change it;
|
|
20
|
+
* or an update by a caller who is not a site admin changes one of the type's owner fields ("Owner
|
|
21
|
+
* fields can only be changed by a site admin"; sending an owner field with its stored value is fine).
|
|
22
|
+
* They are never 401, so the anonymous-token retry does not run for them. On every level but private
|
|
23
|
+
* an update or delete succeeds only for the record's owner (its `userId`, or a user whose id or
|
|
24
|
+
* confirmed email one of the type's owner fields holds) or a site admin, so a record created
|
|
25
|
+
* anonymously that no owner field ties to a user is changed only by a site admin; anyone else gets a
|
|
26
|
+
* 404 `entity_record_not_found`, which is not one of these codes.
|
|
21
27
|
*/
|
|
22
28
|
export type RemixerAccessDenialCode = 'sign_in_required' | 'admin_required' | 'data_access_denied';
|
|
23
29
|
|