You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f6c6193
Browse filesBrowse the repository at this point in the historyBrowse files
feat(plugin-security): one business sentence per built-in permission set, translated (#26090)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X1tNqzSWRgqddaNpX6CJvVQ)_Fixes#25967
Clause-②: no
Metadata-protocol: none
## What changes
Setup → Permission Sets lists the platform's own permission sets next to
every app's. Five of them showed no description. The no-bypass
organization admin set and the three MCP agent sets showed text written
for platform engineers. So an administrator choosing a set could not
tell an administrator set from a member set.
Each of the nine sets in `defaultPermissionSets` now has one plain
sentence (at most 160 characters, in the voice of
objectstack-ai/hotcrm#2303) saying who holds it and what it opens or
withholds. The engineering detail from the old no-bypass and MCP
descriptions now lives in code comments beside each set. The ADR-0105 D4
/ finding F2 note stays in the comment, so the string names no decision
id.
| Set | Description (en) |
| --- | --- |
| `admin_full_access` | Platform operators: read and change every record
in every organization, manage all users and settings, and author apps in
Studio. |
| `organization_admin` | Owners and admins of an organization: full
control of its records and members in Setup, but no app authoring or
platform-wide settings. |
| `organization_admin_no_bypass` | Organization admins on a deployment
with no wall between organizations: the same administration, but only
the records their ownership and sharing open. |
| `member_default` | Every signed-in member's baseline: their own
profile, keys and inbox and the member directory; business records come
from their other sets. |
| `viewer_readonly` | Read-only users: read records across every object,
as far as sharing allows, but create, edit or delete nothing. |
| `external_default` | People from outside the organization, such as
customers or suppliers: their own profile and records, plus only what is
shared with them. |
| `mcp_agent_data_read` | AI assistants a user connects with read
access: they read what that user can read and change nothing. |
| `mcp_agent_data_write` | AI assistants a user connects with read and
write access: they read and change what that user can, except user and
sign-in data. |
| `mcp_agent_restricted` | AI assistants a user connects without data
access: they can run the actions they were allowed, but read or change
no record. |
**Translations.** zh-CN, ja-JP and es-ES (the three locales this
plugin's bundle already carries) get each sentence through the
`permissions.NAME.description` group that #25652 added.
`translatePermissionSet` overlays it on `GET /meta/permission`. The
entries are hand-authored in
`packages/plugins/plugin-security/src/translations/permission-sets.ts`
and merged into `SecurityTranslations`. The generated
`*.objects.generated.ts` files are not touched. No set's grants, name or
label changed.
**Files:** `default-permission-sets.ts` (descriptions and comments),
`translations/permission-sets.ts` (new), `translations/index.ts`
(merge), `objects/permission-set-descriptions.test.ts` (new pin),
`objects/default-permission-sets.test.ts` (the admin capability pin now
leaves the copy out of its comparison), one `patch` changeset.
## Evidence
Live read, `pnpm dev:crm -- --fresh` built from head `a42ae5be`, signed
in as the seeded admin. This is `GET
/api/v1/meta/permission?scope=environment`, the list behind
`/apps/setup/metadata/permission`. With `Accept-Language: zh-CN` it
serves, for example:
- `organization_admin`: 组织的所有者和管理员:在设置中全面管理本组织的记录和成员,但不能构建应用或修改平台级设置。
- `viewer_readonly`: 只读用户:在共享允许的范围内查看所有对象的记录,但不能新建、编辑或删除任何内容。
All nine built-in sets served their zh-CN sentence and, under `en`,
their English sentence. The CRM example declares only `en` and `zh-CN`
(`GET /api/v1/i18n/locales`), so ja-JP was read on `pnpm dev:todo --
--fresh` (it declares ja-JP), and all nine ja-JP sentences were served.
No example declares es-ES, so es-ES is pinned at unit level only. I did
not build the console in this container, so there is no browser
screenshot. The REST read above is the list the page renders.
## Tests (head `a42ae5be`)
- `pnpm --filter @objectstack/plugin-security test`: Test Files 224
passed (224), Tests 4741 passed, 45 skipped. `pnpm --filter
@objectstack/plugin-security typecheck`: exit 0.
- New pin `permission-set-descriptions.test.ts`: every set carries one
sentence (no line break, at most 160 characters, one closing full stop,
no code span, no set id), no two sets share a description, and each
translated locale carries exactly the nine sets with a translated
sentence and no label.
- Ablation, run on the committed tree (`scripts/ablation-replace.mjs`,
then restored, blob hashes equal to HEAD):
- renaming `viewer_readonly` in all three locale groups failed 6 tests;
- deleting `viewer_readonly`'s source description failed 1 test.
- `default-permission-sets.test.ts` "parsed declaration deep-equals the
pre-#11965 inline literal" went red when the admin set gained a
description. It now compares the set without its `description`, which is
copy, not capability. The capability literal is unchanged.
## Gates
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 69 families on `a42ae5be`. All 69
ran and every exit is 0. `--ran` reconciliation: 69 derived, 69 run, 0
NOT-MEASURED, 0 UNRUN. `check-plugin-teardown-shape --self-test` first
exited 3 because the checkout is shallow. It exited 0 after fetching its
positive-control commit. `pnpm check:i18n` reported all bundles in sync.
Scoped `eslint --no-inline-config packages/plugins/plugin-security`
exited 0. CI runs everything else.
## Acceptance notes
- **Why the translations are hand-authored, not generated.** This
plugin's extract runs objects-only, and stack mode needs a flag spelling
that the `check:i18n` docstring harvester
(`scripts/i18n-bundle-surface.mjs`) does not recognise. Generating the
group would have meant changing that tooling and renaming the four
generated exports. I kept to the claim's file surface and did neither.
The cost is that no provenance table judges these entries. If a source
sentence changes later, its three translations go stale silently unless
the same change re-translates them. The file header says so. The new pin
catches a missing or English-copy entry, not a stale one.
- **Labels stay untranslated.** Labels were out of scope under the
ruling. The zh-CN read above serves `Administrator — Full Access` next
to the app's own `CRM 销售用户`. This is reported to the seat, not fixed
here.
- Main moved 12 commits after the branch point. None touch
`plugin-security` or the translation code, and `git merge-tree` merges
cleanly. I did not merge main.
- No other open PR touches `default-permission-sets.ts` or
`plugin-security/src/translations/` (all 40 open PRs read at pr_create).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JzRY5bknrRuK7CHuyu6Aw7)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Every built-in permission set says who holds it, in English, Chinese, Japanese and Spanish
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
Setup → Permission Sets lists the platform's own permission sets beside every app's. Five of them (*Administrator — Full Access*, *Organization Administrator*, *Member — Standard Access*, *Viewer — Read-Only* and *External Member — Own Records*) had no description, and the no-bypass organization administrator set and the three MCP agent sets had descriptions written for platform engineers. An administrator picking a set for a new user could not tell an administrator set from a member set.
11
+
12
+
Each built-in set now has one plain sentence saying who holds it and what it opens or withholds. For example, *Organization Administrator* reads "Owners and admins of an organization: full control of its records and members in Setup, but no app authoring or platform-wide settings." The sentences are translated into zh-CN, ja-JP and es-ES through the permission-set group of the translation bundle (`permissions.<name>.description`), so the page shows them in the user's language. The engineering detail that used to be in the no-bypass and MCP descriptions is now in code comments.
13
+
14
+
No set's grants, name or label changed. This changes only the text shown about each set, not its permissions.
@@ -1543,11 +1574,7 @@ function deriveWallLessOrgAdmin(base: PermissionSet): PermissionSet {
1543
1574
name: ORGANIZATION_ADMIN_NO_BYPASS,
1544
1575
label: 'Organization Administrator (no record bypass)',
1545
1576
description:
1546
-
'Organization administration WITHOUT blanket record visibility. Granted instead of '+
1547
-
'`organization_admin` when the tenancy posture enforces no organization wall, where nothing '+
1548
-
'would bound the superuser bits. Ownership, sharing and business '+
1549
-
'RLS still apply; grant `admin_full_access` (or an explicit set carrying the bits) when a '+
1550
-
'deployment-wide data superuser is genuinely intended.',
1577
+
'Organization admins on a deployment with no wall between organizations: the same administration, but only the records their ownership and sharing open.',
0 commit comments