Delegated administration
Make a group the administrators of a realm and every realm beneath it, or let it only look, with reach that descends and never climbs.
Available, with limitsAPI
Delegated administration decides who may read, change or hand on a realm’s configuration. You give that right to a group, and its members administer your realm and the realms beneath it, and nothing else. It is how you hand a team its own realm: a business unit, a partner or a customer of yours runs it, while you keep oversight from above.
Administration is its own plane, separate from the policies that protect your apps. It answers one question: may this user read, change or delegate this realm’s configuration?
Before you begin
Section titled “Before you begin”- Privilege:
DELEGATEon the realm’s delegation configuration, whichRealmOwnergives. You can grant only what you hold yourself. - Where: the API, at
https://foobar.cvyuh.com/api/v0/am/privilege/v1. - First: the group you’ll grant to must exist in the realm: see
Add groups and members. Your session is in
$CVYUH_SESSION(Call the API).
How it works
Section titled “How it works”A privilege bundles permission templates. A template names part of a realm’s configuration, where *REALM
stands for the realm the privilege is held in, and the actions it allows: READ, MODIFY and DELEGATE. Every realm
holds two privileges from the start:
| Privilege | Template | Actions | Gives |
|---|---|---|---|
RealmOwner | *REALM/* | READ, MODIFY, DELEGATE | Full administration, including granting it to others |
RealmViewer | *REALM/* | READ | Every setting and object to read, and no change |
A privilege is held by groups, never by a user directly. To make someone an administrator, put them in a group and
grant the group the privilege. A privilege may instead be held by every signed-in user of the realm
(allAuthenticated).
Reach descends. A group holding RealmOwner in foobar administers foobar and engineering beneath it; one
holding it in engineering can’t reach foobar. Nothing is copied into a realm beneath, so a grant made today
reaches realms created tomorrow.
Set it up
Section titled “Set it up”Grant a privilege to one of the realm’s groups, naming the privilege every time. Here the finance group may read
everything in foobar and change nothing:
curl https://foobar.cvyuh.com/api/v0/am/privilege/v1 \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \ -H "Content-Type: application/json" \ -d '{ "group": "finance", "privilege": "RealmViewer" }'The realm answers 201, naming the group and the privilege. To grant in a realm beneath yours, make the same call on
that realm’s host name, to one of its own groups.
List each privilege and the groups that hold it:
curl https://foobar.cvyuh.com/api/v0/am/privilege/v1 \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"{ "privileges": [ { "name": "RealmOwner", "groups": ["foobar_admins"], "allAuthenticated": false }, { "name": "RealmViewer", "groups": ["finance"], "allAuthenticated": false } ] }Take one back, naming the privilege here too: left out, it means RealmOwner. The realm answers 200.
curl -X DELETE "https://foobar.cvyuh.com/api/v0/am/privilege/v1/finance?privilege=RealmViewer" \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"Roles of your own
Section titled “Roles of your own”When RealmOwner gives too much and RealmViewer too little, write a privilege of your own. Templates live at
https://foobar.cvyuh.com/api/v0/am/objects/v1/delegationPermission, privileges at
https://foobar.cvyuh.com/api/v0/am/objects/v1/delegationPrivilege. Reading them needs READ on the realm’s
delegation configuration, and writing them MODIFY.
A template’s resource names what it covers. Objects you change through /api/v0/am/objects/v1/<type> are
*REALM/entity/<type>/*: the type, and every object of it. * matches anything, / included, so *REALM/* is
everything.
Here, a privilege that lets the engineering group run sign-in for foobar (its sign-in settings and chains) and
nothing else:
-
Write a template for each type it covers.
Terminal window curl "https://foobar.cvyuh.com/api/v0/am/objects/v1/delegationPermission?id=signInSettings" \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "resource": "*REALM/entity/authSettings/*", "actions": ["READ", "MODIFY"] }'curl "https://foobar.cvyuh.com/api/v0/am/objects/v1/delegationPermission?id=signInChains" \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "resource": "*REALM/entity/authChain/*", "actions": ["READ", "MODIFY"] }' -
Write the privilege, and link the templates to it.
Terminal window curl "https://foobar.cvyuh.com/api/v0/am/objects/v1/delegationPrivilege?id=SignInAdmin" \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "allAuthenticated": false }'curl https://foobar.cvyuh.com/api/v0/am/objects/v1/delegationPrivilege/SignInAdmin/relationships/permissions \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-H "If-Match: *" \-d '{ "targetId": "signInSettings" }'Link
signInChainsthe same way. -
Grant it through
privilege/v1, as above:{ "group": "engineering", "privilege": "SignInAdmin" }. Who holds a privilege is only ever written there.
What happens when it fails
Section titled “What happens when it fails”| Answer | Cause | What to do |
|---|---|---|
403, “not permitted on …” | Your rights don’t cover the change; the message names what was refused | Ask for a privilege that covers it, in this realm or one above |
403 on a grant | You’d grant something you don’t hold yourself, or you’re granting in a realm beside yours | Grant only what you hold, from a realm above the target |
404 on a grant | No such group, or no such privilege, in this realm | Create the group first; check the privilege’s name |
404 on a take-back | The group doesn’t hold that privilege | Name the privilege it holds |
An administrator whose privilege is taken back keeps their session, and is refused their next change.
Limits and defaults
Section titled “Limits and defaults”| What | Default | Can it change |
|---|---|---|
| Privileges every realm starts with | RealmOwner, RealmViewer | Add your own; the two stay |
privilege left out of a grant or take-back | RealmOwner | No: always name it |
| Templates that reach realms beneath | Only *REALM/* | No |
| Who holds a privilege | Groups, or every signed-in user (allAuthenticated) | Never a user directly |
Troubleshooting
Section titled “Troubleshooting”- A role of your own works here but not in a realm beneath. Only
*REALM/*descends. A narrower template, like*REALM/entity/authSettings/*, applies only in the realm that holds the privilege. Hold the privilege in each realm where it should apply. - A user in the group is still refused. Rights are checked on every request, so check the user really is a
member, with
GET https://foobar.cvyuh.com/api/v0/am/objects/v1/user/<user>?expand=memberOf, and that they signed in to this realm or one above it, not to a realm beside it. - Everyone can read the configuration. A privilege has
allAuthenticatedset. List the privileges, and set it tofalseon any that shouldn’t reach every user.
Audit record
Section titled “Audit record”A grant or take-back is a change to the privilege: an UPDATED record naming who made it and the link added or
removed. Read it as the privilege’s change history, such as
GET https://foobar.cvyuh.com/api/v0/am/objects/v1/delegationPrivilege/RealmOwner/history. Templates and privileges
of your own have their history at their own addresses the same way. A refused admin call changes nothing, and isn’t on
the audit trail.
Good to know
Section titled “Good to know”- Where you stand is the realm you signed in to. Nothing in a request moves it. You may call another realm on its host name; whether you may act there is decided from where you stand.
- Beneath means beneath. A realm named
sales-2besidesalesis not beneath it, andsales’s administrators don’t reach it. RealmViewerreads everything and is refused every change.- No second check for sensitive changes. A session that holds
RealmOwnercan make any change for as long as it lasts; no admin change asks for a fresh sign-in. Keep administrators’ sessions short with the realm’s Sessions settings.
Related
Section titled “Related”- Realms and sub-realms: create the realm you hand over.
- Get started with Platform: a team’s realm, end to end.
- Entitlements: the policies that protect your apps, a separate plane.