Repository navigation
fix(platform): keep Automations to owners, admins and developers - #3983
Conversation
Automations is a builder's section. Only Owners, Admins and Developers (the server's author gate, the client's `developerSettings` ability) now get any of it; Members and Editors get none, whatever the organization runs. This reverses the reader visibility #3779 added a day earlier. - The rail and phone tab-bar entry show only for that rule (`features/automations/lib/access.ts`, `useCanUseAutomations`); the live-automation availability read and the reader-only list filter and empty state are gone. - A project's Automations tab is shown, and its listing read, only for them. - Every automation page, org and project scope, sits behind `AutomationsAccessGate` in a new layout route: others get Access denied (`accessDenied.automations`). An author keeps the page while the role refetches, so an open editor never unmounts. - The detail title never names an automation for a denied viewer, cold deep links included (`loaderAbility`, `loadAutomationName`). - Task surfaces keep a run's name, steps, questions and approvals, but drop "View automation" and "Open the full run" for others. - Home never reopens a project automation page for someone who cannot open it. - A linkless system org notification lands on the org home, and an agent question from a project run with no task, answerable only on its run page, notifies only Owners, Admins and Developers. Server reads, test runs, cancels and task-side answers stay open to every member, because tasks and the Inbox rely on them.
The platform guides still said Members and Editors see Automations once an organization-wide automation is deployed, open run lists, and answer or decide on the run detail. In EN, DE and FR they now say that only Owners, Admins and Developers see Automations, its runs and a project's Automations tab, and that a run working a task shows its question and approval cards on the task, where anyone who can open the task acts on them. The roles table no longer calls workflow resources read-only for Editors.
|
Review of exact head 9401837: one remaining UI consistency issue. A live role downgrade leaves the automation name in the browser title. Open an automation detail as a Developer, then let its member-context query resolve to Member. Independent local reproduction with the production gate, role loader, detail route loader/head, real TanStack Router/HeadContent and QueryClient: title is Please update/override the metadata when the resolved role denies access (including the project route), with a role-transition regression. Preserve the current behavior that keeps an author's editor mounted during an ordinary membership refetch. Other bounded evidence: 131 affected UI tests, 85 server/scope tests, and 28 docs checks pass using retained local dependencies. Seventeen selected assertions fail against the prior implementation and pass here, confirming the role/navigation/task-link/Home fixes. Generated-route inspection places all 12 automation descendants under one of the new gates. EN/DE/FR and both modified manual guides were checked. No full-stack validation, formal approval or merge is implied. |
An automation detail route titles the tab from what its loader read when
the page opened. When the viewer's role is lowered while the page is open,
the gate swaps the page for Access denied but no loader reruns, so the tab
kept the automation's name. The gate now claims the section's own title
("Automations - <org>") through `useDocumentTitle` whenever it denies, in
the organization and project scope alike, and hands the page's title back
when the denial goes away. An author's page, and its title, stay as they
were during an ordinary membership refetch.
|
Fixed in 3f1228b, the live role downgrade leaving the automation's name on the tab.
Regressions:
The two transition tests fail with the claim removed. |
|
Follow-up independent review at Reproduction through both actual organization and project routes: open a named automation as Developer, resolve membership to Member (body disappears/title becomes generic), then reject a background membership refresh. React Query retains Member data and sets Let the title claim remain tied to the known lack of ability, independently of the loading predicate used for the denial body. Preserve authorized pending-refetch drafts, role recovery and navigation cleanup. Add the Developer→Member→failed-refetch case in both scopes. Existing author/prior controls:26/26 pass. Independent actual-route controls:6 pass /2 required assertions fail; clean local Chromium confirms both failed-refetch cases. Actual gate, title hook, ability predicate and TanStack head run with synthetic membership/action seams; no production/backend data exposure or new authentication vulnerability is claimed. This completes the same prior title finding, not a new root cause. Retained dependencies were used; no full frozen install or a11y/layout signoff. React Doctor on the exact three-file delta found no issues. Full current-head CI is still a separate gate. |
After a role was lowered on an open automation page, a rejected membership refetch keeps the Member data but raises the dashboard's loading flag. The gate's title claim followed that flag too, so it let go and the automation's name came back on the tab over the empty page. The claim now follows the ability alone: whoever lacks it keeps the section's name, whatever is loading. An author's page and title, role recovery and the claim's release on navigation are unchanged.
|
Fixed in 7470b10: a failed membership refetch after a role downgrade no longer brings the automation's name back. The title claim in Regressions: Developer → Member → failed refetch in |
|
Merged-source reconciliation: the failed-membership-refetch title finding from the preceding review is fixed on actual squash source 91ce574 (final author head 7470b10). The generic title claim now follows canUse independently of the loading flag. The unchanged independent actual-route controls move from 6 pass / 2 fail on 3f1228b to 8 pass / 0 fail on the squash. All 39 focused tests pass. Local Chromium reproductions in organization and project scopes retain “Automations - Tale” with an empty protected body during cached-Member/rejected-refetch states; authorized pending drafts, late-head masking, role recovery and navigation cleanup also pass. Final-head hosted UI separately executed on GitHub test merge aa5d8ee, with a cache miss and 4,928 passing tests. That CI source is not the squash source used by the local proof. No production test or broad layout/a11y/provider claim. All historical failing evidence remains preserved; this finding needs no further issue or patch. |
Summary
Automations is now only for Owners, Admins and Developers. Members and Editors no longer get the rail and phone tab-bar entry or a project's Automations tab, whatever the organization runs. A typed or bookmarked automation URL shows Access denied, and task and notification links into Automations are gone for them. This reverses the reader visibility #3779 added a day earlier.
What changed
features/automations/lib/access.ts(canUseAutomations: thedeveloperSettingsability, the client side of the server's author gate) anduseCanUseAutomations.useAutomationsAvailability,reader-listingand the reader empty state (automations.list.emptyReader.*) are gone. The list is back to its pre-feat(platform): show readers live automation navigation #3779 form.automations/route.tsx(org) andprojects/$projectId/automations/route.tsx, wrap every automation page inAutomationsAccessGate, which showsaccessDenied.automations.routeTree.gen.tsis regenerated.loadAutomationNameandloaderAbilitykeep the tab title from naming an automation for a denied viewer, cold deep links included.systemorg alert, which every member sees, now lands on the org home instead of Automations.NAV-F43andAUTO-F53are rewritten, keeping their IDs.Left as is, on purpose
backend/domains/automations/routes.ts).automations/…path. Someone who is only a Member in the target org lands on Access denied, which is how the role-gated Settings pages already behave.Checklist
bun run check: not run in full on this shared host. The scoped gates below ran instead, and CI runs the full check.tsc --noEmit.oxfmt --checkon every changed file.knip,lint:manual,lint:conflicts, andcheck-guide.tson the two suites.test:ui(550 files, 4841 tests) and the server and pii suites. That run exposed one failure: the reserved-segments scanner now skips layout and test files.main: 175 UI files (1490 tests) and 47 server files (613 tests) in the affected areas.bun run lint:sastpasses: full run, 467 rules, 0 findings.accessDenied.automationsadded andautomations.list.emptyReader.*removed inmessages/{en,de,fr}.yml. Node-CHoverride is needed (no ß).docs/{en,de,fr}/: platform index, member overview, members and roles, automations catalog, execution logs, approval concepts, approvals in workflows, projects overview and task automation.README.md/README.de.md/README.fr.md: N/A, no README-level change.Test plan
mainand pass here: nav entry, tab bar, project tab, the two task links, Home memory and the system-notification fallback.loaderAbility,loadAutomationName, and the question-notification recipients.NAV-F43covers the rail and tab bar by role, plus the direct URL.AUTO-F53covers the pages, the project tab, the task links and Home as a Member or Editor./automations, an automation's/runsand/general, and the project's/automationsall show Access denied inside the shell.