diff --git a/CHANGELOG.md b/CHANGELOG.md index 2286623..e13d648 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,3 +88,6 @@ the admin is mounted. The admin provides it; core reads it instead of assuming `patchFields`; `EditorIdentity` and `InlineEditRequestContext` are declared. Page-event payloads (`onPageMove`'s `PageMovePayload`, and the others by documentation) carry an optional `actor`. +- `EditorIdentity.relation` (`admin` | `editor` | `author`): the admin-tier + relation core decided for the editor from the site's role grants, for + providers that apply an ownership rule. diff --git a/src/inline-edit.ts b/src/inline-edit.ts index 38b4e50..eba6621 100644 --- a/src/inline-edit.ts +++ b/src/inline-edit.ts @@ -42,6 +42,13 @@ export interface EditorIdentity { username: string; /** Every role on the user record (admin-tier roles and content-gating tags mixed). */ roles: string[]; + /** + * The admin-tier relation this editor holds on the site: `admin` and `editor` may edit any + * page, `author` only the pages it created. Decided by core from the site's + * `system.role_grants` (a group `staff` mapped to `editor` makes its members `editor`), so a + * provider applies ownership rules to this and not to role names. + */ + relation: "admin" | "editor" | "author"; /** `site`: signed in through the site's own login; `session`: through the `editor.session` provider. */ source: "site" | "session"; }