Skip to content

Widget Dashboard: govern Reset to default through the policy #82007

Closed

Description

@retrofox

Part of #79231. Follow-up to #81967 (#81967 (comment)).

What problem does this address?

"Reset to default" (the actions menu item and the core/dashboard/reset-to-default command) only depends on onLayoutReset being provided; the policy is never asked. A user denied every operation can still reset the layout, and a reset replaces the committed layout, so an instance the policy locks against remove goes with it.

What is your proposed solution?

A reset operation in the policy vocabulary, { operation: 'reset' }, gating both triggers. Reset is a distinct, destructive change with its own trigger and confirmation, so it should not ride on customize: a host may allow arranging without allowing a reset. Ungoverned operations are allowed by default, so adding it changes nothing for existing hosts.

Open question: whether the policy also weighs in on what the default layout re-adds or drops, or whether that stays with the host, which owns the default.

Tasks

  • Add reset to DashboardOperationRequest and gate the menu item and the command.
  • Deny it for the Viewer and Arranger profiles in the Policy story.
  • Document it in the operations table (README and Policy page).

Location

  • packages/widget-dashboard/src/components/actions/actions.tsx
  • packages/widget-dashboard/src/components/commands/commands.tsx
  • packages/widget-dashboard/src/types.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions