Skip to content

Commit 7fd5d2f

Browse files
committed
docs(permissions): the clone door's package target and landing
Claude-Session: https://claude.ai/code/session_01FEkQ5khiLzZmecWFfjSZLc Co-authored-by: Claude <noreply@anthropic.com>
1 parent 76b93c1 commit 7fd5d2f

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

‎content/docs/concepts/metadata-lifecycle.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ See [ADR-0005](https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/
148148
| :--- | :--- |
149149
| `flow` | Clone it under a new name (`POST /api/v1/automation/:name/clone`, body `{name, label}`), or switch it off (`POST /api/v1/automation/:name/toggle`, body `{enabled: false}`). A flow that holds a credential (an inbound hook's `secret`, an `http` node's `signingSecret`) is not cloned in one step: the clone door refuses it with `409`, because a copy would share the secret, and the copy is authored as a new flow with its own. |
150150
| `action` | Switch it off (`POST /api/v1/actions/_activation/:object/:action`, body `{enabled: false}`; `:object` is `global` for an object-less action). No clone is offered. |
151-
| `permission` | Clone it under a new name: the "Clone" action on the permission set, or the clone door `POST /api/v1/security/permission-sets/:name/clone` (body `{name, label}`) with a new name. The clone door copies the whole definition from the security catalog. |
151+
| `permission` | Clone it under a new name: the "Clone" action on the permission set, or the clone door `POST /api/v1/security/permission-sets/:name/clone` (body `{name, label, package?}`) with a new name. The clone door copies the whole definition from the security catalog; a copy of a packaged set lands in the package's paired `<X>.custom` (ADR-0146 D3/D6). |
152152

153153
A permission set and a position also have a switch, outside the refusal: `POST /api/v1/security/_activation/:type/:name` (`:type` = `permission` or `position`), body `{enabled: false}`, switches one off for the deployment. The refusal does not name it: a packaged position's refusal keeps the managed seal's edit remedy. The audience anchors `everyone` and `guest` are not switchable.
154154

‎content/docs/permissions/permission-sets.mdx‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,16 +425,29 @@ package and re-publish it (ADR-0086 two-doors).
425425
### Cloning a permission set (ADR-0126 §7.1)
426426

427427
```text
428-
POST /api/v1/security/permission-sets/:name/clone body: { "name": "...", "label": "..." }
428+
POST /api/v1/security/permission-sets/:name/clone body: { "name": "...", "label": "...", "package"?: "..." }
429429
```
430430

431431
The clone door copies a set's whole definition under a new machine name. It
432432
reads the source from the security catalog, where every packaged and
433433
environment-authored set lives. It saves the copy through the metadata layer
434-
as a set authored in this system: no package, and no link back to the set
435-
it was copied from, so changes to the source never reach the copy.
436-
437-
- **The body is `{ name, label }`, both required, and nothing else.** `name` is
434+
as a **new** set beside the original, with no link back to it, so changes to
435+
the source never reach the copy.
436+
437+
- **Where the copy lands (ADR-0146 D3/D6).** With no `package`, a copy of a
438+
set shipped by a read-only package X is saved in X's paired customization
439+
package `<X>.custom`, the package that holds everything you changed about X.
440+
The pair is created on the first copy, by the same ensure door as
441+
`POST /api/v1/packages/:id/ensure-customization` (its only creation path),
442+
and reused after. A copy of a set already in a writable package is
443+
saved in that package, and a copy of a set authored in this system stays
444+
environment-wide, in no package. With `package`, the copy is saved there: it
445+
must be an installed, writable package (else `422`
446+
`WRITABLE_PACKAGE_REQUIRED`) whose declared dependencies reach the source's
447+
package and every object the set grants on (else `409` `RESOURCE_CONFLICT`).
448+
The response's `package` names where the copy went (`null` for
449+
environment-wide), and the copy is assigned by its bare name like any set.
450+
- **The body is `{ name, label, package? }`, `name` and `label` required, and nothing else.** `name` is
438451
a new snake_case machine name: a name failing that rule answers `400`, and a
439452
name any permission set already uses (the source's own included) answers `409`
440453
`RESOURCE_CONFLICT`. An unknown source answers `404`.
@@ -444,8 +457,8 @@ it was copied from, so changes to the source never reach the copy.
444457
(`packageId`, `protection` and the internal protection envelope),
445458
and two privilege decisions — `adminScope` (delegated administration) and
446459
`isDefault` (the `everyone` suggestion). Grant either deliberately on the copy
447-
if it needs one. The response, `{ permissionSet, notice }`, says what was not
448-
copied.
460+
if it needs one. The response, `{ permissionSet, package, notice }`, says
461+
where the copy went and what was not copied.
449462
- **The copy is held by nobody** until you add it to a position or assign it.
450463
- **Who may call it** is who may save a permission set through the metadata
451464
API: a holder of `manage_metadata`. Anyone else is refused `403`

0 commit comments

Comments
 (0)