2828 *
2929 * [#22360] PROVENANCE: the row of a position a code package holds is stamped
3030 * `managed_by: 'package'` — on insert, and on an existing row that lacks a
31- * managed value — so the system-row write gate refuses an admin-door edit or
32- * delete of it, as the metadata door already refuses one (ADR-0131 D6). See
33- * {@link packageProvenanceStamp}.
31+ * managed value — so the system-row write gate refuses an admin-door edit of
32+ * its definition, or a delete of it, as the metadata door already refuses one
33+ * (ADR-0131 D6). Its row state (`active`, `is_default`) stays switchable, as a
34+ * packaged permission set's does — carve-out (d) of the gate in
35+ * `security-plugin.ts`. See {@link packageProvenanceStamp}.
3436 */
3537
3638import { createSecurityCatalogReader } from '@objectstack/core' ;
@@ -230,7 +232,8 @@ function packageHoldsName(registry: any, entry: { name: string; packageId?: stri
230232 * back over it with no message. The metadata door refused the same edit
231233 * (`403 NOT_OVERRIDABLE`). ADR-0131 D6: no door edits a managed definition;
232234 * D3: managed items are read-only and clonable. With the stamp, the data door
233- * refuses through the gate that already protects the six built-ins.
235+ * refuses a definition edit or a delete through the gate that already protects
236+ * the six built-ins; a row-state-only patch passes its carve-out (d).
234237 *
235238 * ## Why this is not a #2909 T2 projection
236239 *
@@ -246,12 +249,13 @@ function packageHoldsName(registry: any, entry: { name: string; packageId?: stri
246249 *
247250 * A declared row written before this carries `admin`. The pass corrects the
248251 * stamp in place — `managed_by` and nothing else beyond the label and
249- * description refresh it always made — so the edit is refused there too, and
250- * the columns an administrator set before the upgrade stay as they are.
252+ * description refresh it always made — so a definition edit is refused there
253+ * too, and the columns an administrator set before the upgrade stay as they
254+ * are.
251255 * ⚠️ That row is matched by NAME, as the label refresh always matched it: a
252256 * Setup-created position whose name a package declares later is taken over by
253- * the package here, and from then on refused at the data door like any other
254- * package position.
257+ * the package here, and from then on its definition is refused at the data
258+ * door like any other package position's .
255259 */
256260function packageProvenanceStamp ( packageHeld : boolean , existing ?: any ) : { managed_by ?: string } {
257261 if ( ! packageHeld ) return { } ;
0 commit comments