diff --git a/.changeset/34908-view-audience-picker.md b/.changeset/34908-view-audience-picker.md
new file mode 100644
index 00000000000..de90ca4e0ff
--- /dev/null
+++ b/.changeset/34908-view-audience-picker.md
@@ -0,0 +1,20 @@
+---
+'@objectstack/spec': patch
+'@objectstack/platform-objects': patch
+'@object-ui/app-shell': patch
+'@object-ui/i18n': patch
+---
+
+feat(app-shell): 「Who sees this view」 — pick a shared view's or a dashboard's audience from the known capabilities, and see which positions will see it
+
+Clause-②: no
+Metadata-protocol: none
+
+The audience gate is the existing, server-enforced `requiredPermissions` (all of the capabilities listed are required). The console now sets it from a closed list and shows who it reaches; no key, value or gate changes, and nothing is granted from the view (granting stays in Setup).
+
+- **`@object-ui/app-shell`.** The view switcher's in-place create card offers 「Who sees this view」 for a shared view: the capabilities the environment knows (declared, or granted by a permission set), each with the permission sets granting it, and a read-only preview of the positions whose permission sets grant every capability picked. The preview reads each position's sets from the server (`GET /meta/position?include=grants`, the sets the resolver grants its holders), never from a position's raw definition; a list served without them leaves the positions unknown. While a gate is picked, the card says it applies to its creator too. It starts from the open view's gate, which a new shared view used to inherit silently, and the pick replaces it; an empty pick writes no gate. A failed catalog read offers nothing to type. The shared hint no longer says every shared view is seen by everyone who can see the list. In Studio, the view panel's and the dashboard settings' audience row is the new `ref-multi:capability` picker: a closed list (no typed-name box when the catalog is unread, empty or failed), each option with its granting sets, and the same preview under it. The picker reads the catalog once its row is on screen, so an editor whose audience section stays closed sends no request.
+- **`@objectstack/spec`.** The view and dashboard forms' `requiredPermissions` rows declare `widget: 'ref-multi:capability'` (the list is closed: a host with no catalog offers nothing to add). The view hint's last sentence now says only what holds on every carrier: the person setting the gate no longer sees the view in the list either.
+- **`@objectstack/platform-objects`.** The `metadataForms` bundles carry the narrowed view hint (zh-CN, ja-JP and es-ES translated; the other locales the English source).
+- **`@object-ui/i18n`.** The create card's new strings and the corrected shared hint, in all eleven console locales.
+
+Nothing to migrate.
diff --git a/content/docs/permissions/capabilities.mdx b/content/docs/permissions/capabilities.mdx
index 24ca2d9f60a..6f555a74631 100644
--- a/content/docs/permissions/capabilities.mdx
+++ b/content/docs/permissions/capabilities.mdx
@@ -197,6 +197,49 @@ the same way; a user who may edit the object still reads all of its list views,
so a save of what they loaded keeps them.
+## Showing a list view to some positions, without code
+
+An administrator can decide who sees a shared list view or a dashboard in the
+console, with no source file. The gate is the same `requiredPermissions` as
+above, and the console only sets it; it grants nothing. Granting stays in
+Setup.
+
+1. **Have a capability for the audience.** Use one your app declares, or
+ declare one in the environment
+ ([below](#declaring-a-capability-in-the-environment)). One capability per
+ audience, for example `crm_deal.view_sales` for "the sales team's deal
+ view".
+2. **Grant it in Setup.** Add the name to the `systemPermissions` of a
+ permission set, and give that set to the positions that should see the
+ view. A position carries no capability of its own: it passes on what its
+ permission sets grant. To show the view to two groups, grant the one
+ capability to both groups' sets.
+3. **Pick it on the view.** In the view switcher, **Add view → Shared** offers
+ **Who sees this view**. For an existing view, Studio's view panel has
+ **Required permissions** under **Navigation & sharing**, and a dashboard's
+ settings have it under **Access**. Both list only the capabilities the
+ environment knows, that is the ones declared and the ones a permission set
+ grants, with the sets granting each. You cannot type a name that matches
+ nothing there.
+
+Under the pick, the console previews the positions that will see the view: the
+positions whose permission sets grant **every** capability picked. It reads
+which sets each position grants from the server, the sets the resolver grants
+its holders, so a position that has been switched off reaches no one. The preview is
+still advice, and the server stays the authority: it cannot name people who
+hold a set directly rather than through a position, nor people who hold the
+picked capabilities between several positions. A person holds everything each
+of their positions grants, so two positions that each grant part of the pick
+let their joint holders through.
+
+
+**The gate applies to you too.** Pick a capability you do not hold, and the view
+leaves your own view switcher as well. A view or a dashboard saved on its own
+is then refused to you on every door, Studio included, until someone grants
+you the capability. Grant it to your own permission set first if you still need
+to open the view.
+
+
## One holder per name
Each capability name has exactly one holder in the registry. When a package
@@ -303,6 +346,7 @@ copy and the two would share one gate. Prefix your capability names.
- [ ] The declaration is reachable from the stack (`capabilities: [...]`) or a `*.capability.ts` file
- [ ] No other installed package declares the same name — the registry refuses a second holder at boot
- [ ] Something actually **requires** the name (`requiredPermissions`), and something **grants** it (`systemPermissions`)
+- [ ] A list view or dashboard gated from the console: its capability is granted to the positions' permission sets, and to your own if you still need to open it
## See also
diff --git a/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts
index 77aa571ceb3..14e8aec4167 100644
--- a/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const arMetadataForms: NonNullable = {
},
requiredPermissions: {
label: "Required Permissions",
- helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you can no longer open this view either."
+ helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you no longer see this view in the list either."
},
object: {
label: "الكائن"
diff --git a/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts
index 1aa6247cb11..425cd5e3b85 100644
--- a/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts
+++ b/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts
@@ -67,7 +67,7 @@ export const arGeneratedSourceHashes: Readonly> = {
"metadataForms.report.fields.exportOptions.formats.label": "193cd91818d64ef7",
"metadataForms.report.fields.exportOptions.includeHeaders.helpText": "44cbc80015ff051d",
"metadataForms.report.fields.exportOptions.includeHeaders.label": "f114a4778c9727ae",
- "metadataForms.view.fields.requiredPermissions.helpText": "c4599be2ffa06c02",
+ "metadataForms.view.fields.requiredPermissions.helpText": "824ea3479e2e607a",
"metadataForms.view.fields.requiredPermissions.label": "a47b2168b71f5e68",
"objects.sys_email.fields.message_id.label": "14cd089a4062f4b1",
"objects.sys_email_template.fields.package_id.help": "e1f8cc4d0105cedc",
diff --git a/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts
index 1918baa469d..8684c74ca38 100644
--- a/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const deMetadataForms: NonNullable = {
},
requiredPermissions: {
label: "Required Permissions",
- helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you can no longer open this view either."
+ helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you no longer see this view in the list either."
},
object: {
label: "Objekt"
diff --git a/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts
index 16eebeb04a9..0a35ec33d1c 100644
--- a/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts
+++ b/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts
@@ -128,7 +128,7 @@ export const deGeneratedSourceHashes: Readonly> = {
"metadataForms.view.fields.kanban.label": "dd95c452aa71459e",
"metadataForms.view.fields.name.label": "5274417ff1ccaf01",
"metadataForms.view.fields.navigation.label": "51cd9fc784a9643f",
- "metadataForms.view.fields.requiredPermissions.helpText": "c4599be2ffa06c02",
+ "metadataForms.view.fields.requiredPermissions.helpText": "824ea3479e2e607a",
"metadataForms.view.fields.requiredPermissions.label": "a47b2168b71f5e68",
"metadataForms.view.fields.userActions.filter.label": "802895ec427fc6af",
"metadataForms.view.fields.userFilters.element.label": "e480e4fe57239c98",
diff --git a/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts
index 25f673b19c7..d67367073e1 100644
--- a/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const enMetadataForms: NonNullable = {
},
requiredPermissions: {
label: "Required Permissions",
- helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you can no longer open this view either."
+ helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you no longer see this view in the list either."
},
object: {
label: "Object"
diff --git a/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts
index ca94e15f7bd..7cb179a9236 100644
--- a/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const esESMetadataForms: NonNullable =
},
requiredPermissions: {
label: "Permisos requeridos",
- helpText: "Quién ve esta vista: las capacidades que una persona debe tener, todas las indicadas. Los conjuntos de permisos otorgan capacidades, y un puesto transmite las que otorgan sus conjuntos de permisos. Si se deja vacío, todos los que pueden ver la lista ven esta vista. Para mostrarla a varios grupos, elija una capacidad y otórguela al conjunto de permisos de cada grupo. El servidor lo aplica: los demás no encuentran la vista en la lista y se les deniega si la abren directamente. Esto también se aplica a usted: si indica una capacidad que no tiene, o la escribe mal, usted tampoco podrá volver a abrir esta vista."
+ helpText: "Quién ve esta vista: las capacidades que una persona debe tener, todas las indicadas. Los conjuntos de permisos otorgan capacidades, y un puesto transmite las que otorgan sus conjuntos de permisos. Si se deja vacío, todos los que pueden ver la lista ven esta vista. Para mostrarla a varios grupos, elija una capacidad y otórguela al conjunto de permisos de cada grupo. El servidor lo aplica: los demás no encuentran la vista en la lista y se les deniega si la abren directamente. Esto también se aplica a usted: si indica una capacidad que no tiene, o la escribe mal, usted tampoco verá esta vista en la lista."
},
object: {
label: "Objeto"
diff --git a/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts
index afa5dd31ca6..e2633b32210 100644
--- a/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const frMetadataForms: NonNullable = {
},
requiredPermissions: {
label: "Required Permissions",
- helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you can no longer open this view either."
+ helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you no longer see this view in the list either."
},
object: {
label: "Objet"
diff --git a/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts
index ebd32ddebcd..5edcd428bcb 100644
--- a/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts
+++ b/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts
@@ -164,7 +164,7 @@ export const frGeneratedSourceHashes: Readonly> = {
"metadataForms.view.fields.navigation.label": "51cd9fc784a9643f",
"metadataForms.view.fields.navigation.mode.label": "74dde5013435abdc",
"metadataForms.view.fields.pagination.label": "309131fbaca258df",
- "metadataForms.view.fields.requiredPermissions.helpText": "c4599be2ffa06c02",
+ "metadataForms.view.fields.requiredPermissions.helpText": "824ea3479e2e607a",
"metadataForms.view.fields.requiredPermissions.label": "a47b2168b71f5e68",
"metadataForms.view.fields.selection.type.label": "901bb552898b2cab",
"metadataForms.view.fields.type.label": "901bb552898b2cab",
diff --git a/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts
index 921d9a48fef..3c03010502a 100644
--- a/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const jaJPMetadataForms: NonNullable =
},
requiredPermissions: {
label: "必要な権限",
- helpText: "このビューを見られる人:閲覧者が保持する必要のあるケイパビリティで、列挙したものはすべて必要です。ケイパビリティは権限セットが付与し、ポジションはその権限セットが付与するものを引き継ぎます。空にすると、リストを見られる全員がこのビューを見られます。複数のグループに見せるには、ケイパビリティを 1 つ選び、各グループの権限セットに付与してください。サーバーが強制します:それ以外の人にはリストにこのビューが表示されず、直接開いても拒否されます。これはあなた自身にも適用されます:保持していないケイパビリティや綴りを誤ったケイパビリティを指定すると、あなたもこのビューを開けなくなります。"
+ helpText: "このビューを見られる人:閲覧者が保持する必要のあるケイパビリティで、列挙したものはすべて必要です。ケイパビリティは権限セットが付与し、ポジションはその権限セットが付与するものを引き継ぎます。空にすると、リストを見られる全員がこのビューを見られます。複数のグループに見せるには、ケイパビリティを 1 つ選び、各グループの権限セットに付与してください。サーバーが強制します:それ以外の人にはリストにこのビューが表示されず、直接開いても拒否されます。これはあなた自身にも適用されます:保持していないケイパビリティや綴りを誤ったケイパビリティを指定すると、あなたのリストにもこのビューは表示されなくなります。"
},
object: {
label: "オブジェクト"
diff --git a/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts
index 671ad38fc06..f8f4e16e934 100644
--- a/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const koMetadataForms: NonNullable = {
},
requiredPermissions: {
label: "Required Permissions",
- helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you can no longer open this view either."
+ helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you no longer see this view in the list either."
},
object: {
label: "객체"
diff --git a/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts
index b440ec908a1..8de3bbc85df 100644
--- a/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts
+++ b/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts
@@ -67,7 +67,7 @@ export const koGeneratedSourceHashes: Readonly> = {
"metadataForms.report.fields.exportOptions.formats.label": "193cd91818d64ef7",
"metadataForms.report.fields.exportOptions.includeHeaders.helpText": "44cbc80015ff051d",
"metadataForms.report.fields.exportOptions.includeHeaders.label": "f114a4778c9727ae",
- "metadataForms.view.fields.requiredPermissions.helpText": "c4599be2ffa06c02",
+ "metadataForms.view.fields.requiredPermissions.helpText": "824ea3479e2e607a",
"metadataForms.view.fields.requiredPermissions.label": "a47b2168b71f5e68",
"objects.sys_email.fields.message_id.label": "14cd089a4062f4b1",
"objects.sys_email_template.fields.id.label": "00b0385c9c152888",
diff --git a/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts
index a9c2c2e0944..2149b6f7354 100644
--- a/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const ptBRMetadataForms: NonNullable =
},
requiredPermissions: {
label: "Required Permissions",
- helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you can no longer open this view either."
+ helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you no longer see this view in the list either."
},
object: {
label: "Objeto"
diff --git a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts
index 9a8c8163394..5eca386c3e6 100644
--- a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts
+++ b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts
@@ -84,7 +84,7 @@ export const ptBRGeneratedSourceHashes: Readonly> = {
"metadataForms.report.fields.exportOptions.includeHeaders.label": "f114a4778c9727ae",
"metadataForms.view.fields.gantt.label": "57ffc6ef520edfc5",
"metadataForms.view.fields.kanban.label": "dd95c452aa71459e",
- "metadataForms.view.fields.requiredPermissions.helpText": "c4599be2ffa06c02",
+ "metadataForms.view.fields.requiredPermissions.helpText": "824ea3479e2e607a",
"metadataForms.view.fields.requiredPermissions.label": "a47b2168b71f5e68",
"metadataForms.view.sections.gantt.label": "57ffc6ef520edfc5",
"metadataForms.view.sections.kanban.label": "dd95c452aa71459e",
diff --git a/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts
index bd40396d57d..d538390d9d0 100644
--- a/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const ruMetadataForms: NonNullable = {
},
requiredPermissions: {
label: "Required Permissions",
- helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you can no longer open this view either."
+ helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you no longer see this view in the list either."
},
object: {
label: "Объект"
diff --git a/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts
index 1a970de4508..2ecfaaa7130 100644
--- a/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts
+++ b/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts
@@ -67,7 +67,7 @@ export const ruGeneratedSourceHashes: Readonly> = {
"metadataForms.report.fields.exportOptions.formats.label": "193cd91818d64ef7",
"metadataForms.report.fields.exportOptions.includeHeaders.helpText": "44cbc80015ff051d",
"metadataForms.report.fields.exportOptions.includeHeaders.label": "f114a4778c9727ae",
- "metadataForms.view.fields.requiredPermissions.helpText": "c4599be2ffa06c02",
+ "metadataForms.view.fields.requiredPermissions.helpText": "824ea3479e2e607a",
"metadataForms.view.fields.requiredPermissions.label": "a47b2168b71f5e68",
"objects.sys_email.fields.message_id.label": "14cd089a4062f4b1",
"objects.sys_email_template.fields.id.label": "00b0385c9c152888",
diff --git a/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts
index c711030e0ba..f3587d2b26f 100644
--- a/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const zhCNMetadataForms: NonNullable =
},
requiredPermissions: {
label: "所需权限",
- helpText: "谁能看此视图:查看者必须持有的能力,列出的每一项都要具备。能力由权限集授予,岗位通过其权限集获得这些能力。留空则所有能看到该列表的人都能看到此视图。要给多类人看,请选一个能力并授予每类人的权限集。由服务器强制执行:其他人在列表中看不到此视图,直接打开也会被拒绝。这也适用于你自己:列出你未持有或拼错的能力后,你也将无法再打开此视图。"
+ helpText: "谁能看此视图:查看者必须持有的能力,列出的每一项都要具备。能力由权限集授予,岗位通过其权限集获得这些能力。留空则所有能看到该列表的人都能看到此视图。要给多类人看,请选一个能力并授予每类人的权限集。由服务器强制执行:其他人在列表中看不到此视图,直接打开也会被拒绝。这也适用于你自己:列出你未持有或拼错的能力后,你在列表中也将看不到此视图。"
},
object: {
label: "对象"
diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts
index 34af280d9f6..123b80915bb 100644
--- a/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts
+++ b/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts
@@ -1661,7 +1661,7 @@ export const zhHantMetadataForms: NonNullable
},
requiredPermissions: {
label: "Required Permissions",
- helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you can no longer open this view either."
+ helpText: "Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone who can see the list sees this view. To show it to several groups, pick one capability and grant it to each group's permission set. The server enforces it: anyone else does not find the view in the list and is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or misspell one, and you no longer see this view in the list either."
},
object: {
label: "物件"
diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts
index dc54a98d4f4..de71721e4db 100644
--- a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts
+++ b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts
@@ -61,7 +61,7 @@ export const zhHantGeneratedSourceHashes: Readonly> = {
"metadataForms.report.fields.exportOptions.formats.label": "193cd91818d64ef7",
"metadataForms.report.fields.exportOptions.includeHeaders.helpText": "44cbc80015ff051d",
"metadataForms.report.fields.exportOptions.includeHeaders.label": "f114a4778c9727ae",
- "metadataForms.view.fields.requiredPermissions.helpText": "c4599be2ffa06c02",
+ "metadataForms.view.fields.requiredPermissions.helpText": "824ea3479e2e607a",
"metadataForms.view.fields.requiredPermissions.label": "a47b2168b71f5e68",
"objects.sys_email.fields.message_id.label": "14cd089a4062f4b1",
"objects.sys_email_template.fields.id.label": "00b0385c9c152888",
diff --git a/packages/spec/src/ui/dashboard.metadata-form.ts b/packages/spec/src/ui/dashboard.metadata-form.ts
index 91cb5891458..c3360881d98 100644
--- a/packages/spec/src/ui/dashboard.metadata-form.ts
+++ b/packages/spec/src/ui/dashboard.metadata-form.ts
@@ -148,7 +148,8 @@ export const dashboardForm = defineMetadataForm({
{
// The audience gate (#34908, ruling 7103739693 letter B): the existing,
// server-enforced `requiredPermissions`, given an authoring row — the
- // list view's row in `view.metadata-form.ts`, worded for a dashboard.
+ // list view's row in `view.metadata-form.ts` (the same `ref-multi:capability`
+ // picker and position preview), worded for a dashboard.
label: 'Access',
description: 'Who can see this dashboard.',
collapsible: true,
@@ -156,7 +157,7 @@ export const dashboardForm = defineMetadataForm({
fields: [
{
field: 'requiredPermissions',
- widget: 'string-tags',
+ widget: 'ref-multi:capability',
helpText: 'Who sees this dashboard: the capabilities a person must hold, every one listed. Permission sets '
+ 'grant capabilities, and a position passes on the ones its permission sets grant. Leave it empty and '
+ 'everyone sees this dashboard. To show it to several groups, pick one capability and grant it to each '
diff --git a/packages/spec/src/ui/view.metadata-form.ts b/packages/spec/src/ui/view.metadata-form.ts
index b6a4450d816..b8aea7e18ac 100644
--- a/packages/spec/src/ui/view.metadata-form.ts
+++ b/packages/spec/src/ui/view.metadata-form.ts
@@ -320,15 +320,25 @@ export const viewForm = defineMetadataForm({
// second audience key. The hint restates the clauses of
// `AUDIENCE_REQUIRED_PERMISSIONS_DESCRIPTION` (all of them, no any-of
// form, enforced by the server) for the administrator who sets it.
+ // `ref-multi:capability` offers only the capabilities the environment
+ // knows (declared, or granted by a permission set) and previews which
+ // positions the picked set reaches; the list is closed, so a host that
+ // feeds no catalog offers nothing to add. It writes the names only —
+ // granting stays in Setup.
+ // The last sentence says what holds for the person setting the gate on
+ // every carrier: the switcher drops the view for them too. It does not
+ // promise the designer refuses it: a view item is refused on every door,
+ // but an entry kept in its object's view set stays open to that set's
+ // editors there.
{
field: 'requiredPermissions',
- widget: 'string-tags',
+ widget: 'ref-multi:capability',
helpText: 'Who sees this view: the capabilities a person must hold, every one listed. Permission sets grant '
+ 'capabilities, and a position passes on the ones its permission sets grant. Leave it empty and everyone '
+ 'who can see the list sees this view. To show it to several groups, pick one capability and grant it to '
+ 'each group\'s permission set. The server enforces it: anyone else does not find the view in the list and '
+ 'is refused if they open it directly. The gate applies to you too: list a capability you do not hold, or '
- + 'misspell one, and you can no longer open this view either.',
+ + 'misspell one, and you no longer see this view in the list either.',
},
],
},
diff --git a/ui/packages/app-shell/src/views/CreateViewDialog.tsx b/ui/packages/app-shell/src/views/CreateViewDialog.tsx
index 01876e3f11e..2cdd6fee390 100644
--- a/ui/packages/app-shell/src/views/CreateViewDialog.tsx
+++ b/ui/packages/app-shell/src/views/CreateViewDialog.tsx
@@ -52,6 +52,9 @@ import type { ListViewVisualization } from '@object-ui/core';
import { slugify } from './metadata-admin/createDerive.js';
import { romanizeHan, useHanRomanizer } from './metadata-admin/romanizeHan.js';
import { datasetOptionLabel, useObjectDatasetBinding } from './studio-design/objectDatasets.js';
+import { usePickerLoad } from './metadata-admin/loadState.js';
+import type { CapabilityAudience } from './capabilityAudience.js';
+import { ViewAudiencePicker } from './ViewAudiencePicker.js';
import {
deriveFieldOptions,
isImageLikeField,
@@ -1082,6 +1085,14 @@ export interface InPlaceViewRequest {
scope: 'personal' | 'shared';
/** Carry the list's unsaved filters and sort into the new view. */
includeCurrent: boolean;
+ /**
+ * objectstack#34908 — a shared view's audience gate as the card's picker
+ * left it: the capabilities a reader must all hold (`[]` = no gate). Present
+ * only when the card offered the picker, and then it is authoritative over
+ * any gate the new view would otherwise inherit from the open one; absent,
+ * the host builds the body as before.
+ */
+ requiredPermissions?: string[];
}
export interface CreateViewCardProps {
@@ -1112,6 +1123,15 @@ export interface CreateViewCardProps {
onCreate: (request: InPlaceViewRequest) => boolean | Promise;
/** Back to the view list. */
onBack: () => void;
+ /**
+ * objectstack#34908 — read the audience catalog (the capabilities the
+ * environment knows, the permission sets granting each, the positions
+ * holding them). Given ⇒ the shared scope offers 「Who sees this view」;
+ * read once the reader picks Shared. Absent ⇒ no picker.
+ */
+ loadAudience?: () => Promise;
+ /** The open view's gate, the picker's starting value (the new view starts from the open one). */
+ initialRequiredPermissions?: readonly string[];
}
/**
@@ -1138,6 +1158,8 @@ export function CreateViewCard({
shownFields,
onCreate,
onBack,
+ loadAudience,
+ initialRequiredPermissions,
}: CreateViewCardProps) {
const { t } = useObjectTranslation();
const allTypes = useMemo(() => buildViewTypeMeta(t), [t]);
@@ -1159,6 +1181,12 @@ export function CreateViewCard({
const [includeCurrent, setIncludeCurrent] = useState(true);
const [scope, setScope] = useState<'personal' | 'shared'>(canCreatePersonal ? 'personal' : 'shared');
const [submitting, setSubmitting] = useState(false);
+ const [requiredPermissions, setRequiredPermissions] = useState(() => [...(initialRequiredPermissions ?? [])]);
+ const offersAudience = scope === 'shared' && !!loadAudience;
+ const audience = usePickerLoad(useMemo(
+ () => (offersAudience ? loadAudience! : null),
+ [offersAudience, loadAudience],
+ ));
const submittingRef = useRef(false);
const baseId = useId();
// Loads the pinyin dictionary for a Chinese name, so the key reads as it.
@@ -1202,7 +1230,12 @@ export function CreateViewCard({
submittingRef.current = true;
setSubmitting(true);
try {
- await onCreate({ config, scope, includeCurrent: hasUnsavedConditions && includeCurrent });
+ await onCreate({
+ config,
+ scope,
+ includeCurrent: hasUnsavedConditions && includeCurrent,
+ ...(offersAudience ? { requiredPermissions } : {}),
+ });
} finally {
submittingRef.current = false;
setSubmitting(false);
@@ -1335,9 +1368,14 @@ export function CreateViewCard({
)}
{scope === 'shared' && (
- {t('view.switcher.scopeHint', { defaultValue: 'Shared views are seen by everyone who can see this list' })}
+ {t('view.switcher.scopeHint', {
+ defaultValue: 'Shared views are seen by everyone who can see this list, unless the view is limited to the holders of a capability',
+ })}