diff --git a/.changeset/23615-grant-unique-index-skill.md b/.changeset/23615-grant-unique-index-skill.md new file mode 100644 index 00000000000..7a644c67e30 --- /dev/null +++ b/.changeset/23615-grant-unique-index-skill.md @@ -0,0 +1,9 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): the `objectstack-data` security rule states a grant's uniqueness as the declared `unique: 'organization'` index holds it, in place of the retired `permission_set_id` column (#23615) + +Clause-②: no + +`skills/objectstack-data/rules/security.md`'s grant paragraph closed with "`permission_set_id` is a legacy column: do not write it." The grant object `sys_user_permission_set` no longer declares that column, so a write naming it is refused `400 INVALID_FIELD` as an undeclared field, and the sentence taught an AI author a key the declared shape does not have. The sentence is replaced by the rule the declared shape holds: one grant per user, set and organization, enforced by the join object's `unique: 'organization'` index on (`user_id`, `permission_set`, `organization_id`). The by-name reference — `permission_set` takes the set's `name` — and its refusals are unchanged. No behaviour changes; nothing an author writes changes. diff --git a/skills/objectstack-data/rules/security.md b/skills/objectstack-data/rules/security.md index 809114e7f73..f9aeb455ada 100644 --- a/skills/objectstack-data/rules/security.md +++ b/skills/objectstack-data/rules/security.md @@ -46,7 +46,7 @@ insert — never author it. ⚠️ **`permission_set` takes the set's `name`, never a record id** — a name the security catalog does not hold is refused `400 VALIDATION_FAILED` (`reference_not_found`), and a row with no name is refused `required`. -`permission_set_id` is a legacy column: do not write it. +One grant per user, set and organization: enforced by the `unique: 'organization'` index. Assignment is one call: `POST /api/v1/data/sys_user_permission_set` with `{ user_id, permission_set: '', organization_id }`. Only a tenant admin —