Skip to content

Add exhaustive e2e coverage for the Permission/Role schema fix, and real RBAC enforcement - #41

Merged
tomchop merged 2 commits into
mainfrom
fix/permission-role-schema-e2e
Aug 11, 2026
Merged

Add exhaustive e2e coverage for the Permission/Role schema fix, and real RBAC enforcement#41
tomchop merged 2 commits into
mainfrom
fix/permission-role-schema-e2e

Conversation

@tomchop

@tomchop tomchop commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds exhaustive e2e coverage for the Permission/Role schema fix (Make the Role schema honestly reflect the composite values it accepts yeti#1342, Remove the Permission/Role type-widening workarounds yeti-feeds-frontend#307), across both UI paths that grant a role.
  • rbac-group-membership.spec.ts: now loops over every role ACLEdit's own picker offers (Reader/Writer/Owner) instead of just one, and confirms the persisted ACL edge's exact role value via a direct API check each time.
  • user-global-role.spec.ts (new): covers UserProfile.vue's "Global role" combobox across all four values, including "No access" (0) -- the one boundary value ACLEdit's own picker never offers.
  • permission-enforcement.spec.ts (new): the above two specs only ever run as admin, who bypasses every permission check, and RBAC was disabled on this stack -- so nothing exercised real enforcement, only that ACL values get persisted correctly. Enables YETI_RBAC_ENABLED and adds a test that logs a second, non-admin user's own browser session in alongside the admin's, walking a single entity through group-based Owner access, revocation, Reader, Writer, and Owner again -- asserting both that the UI hides actions that role shouldn't have and that the backend rejects an unauthorized action attempted directly against the API.

Test plan

  • All three specs run clean together, individually and repeatedly, against a live isolated stack built from the fix branches
  • Full integration suite (all 16 specs) run clean twice from a fresh build with RBAC enabled -- no regressions in any other spec
  • tsc --noEmit clean on the playwright test suite

Exercises the two UI paths that grant a role (yeti-platform/yeti#1342,
yeti-platform/yeti-feeds-frontend#307): ACLEdit's per-object grants and
a user's global role. rbac-group-membership.spec.ts now loops over
every role ACLEdit's own UI offers (Reader/Writer/Owner) instead of
just one, reopening the ACL dialog fresh each iteration since Escape
(used to dismiss the identities combobox's own dropdown) isn't
guaranteed to only close the topmost nested overlay. The new
user-global-role.spec.ts covers UserProfile.vue's "Global role"
combobox across all four values, including "No access" (0) -- the
one boundary value ACLEdit's picker never offers, and the value the
old Permission-flag-derived type could never express.
…orage

The existing RBAC specs only ever run as admin, who bypasses every
permission check, and RBAC is disabled on the integration stack -- so
nothing so far actually exercises enforcement, only that ACL values get
persisted correctly. Enable YETI_RBAC_ENABLED on the stack and add a
test that logs a second, non-admin user's own browser session in
alongside the admin's, then walks a single entity through group-based
Owner access, revocation, Reader, Writer, and Owner again, asserting at
each step both that the UI hides the actions that role shouldn't have
(Edit/Delete/Share gating in ObjectDetails.vue/EditObject.vue) and that
the backend rejects an unauthorized action attempted directly against
the API, not just that the button is hidden.

Parameterize helpers.ts's login() to accept a username/password, since
this is the first spec that needs the browser itself logged in as a
second user rather than just holding their bearer token for API calls.

The initial grant targets the "All users" group rather than the second
user directly, mirroring what yeti.conf's default_acls is meant to do
automatically for every new object (it grants that group Owner, not
merely read access, despite the config comment). That automatic grant
turned out to intermittently and silently miss under load (Group.find()
failing to find an existing group, permanently under-sharing the
object with no retry) -- worth knowing about, but out of scope here --
so the test grants it explicitly through the same UI action instead of
relying on it, for a deterministic starting point.
@tomchop tomchop changed the title Add exhaustive e2e coverage for the Permission/Role schema fix Add exhaustive e2e coverage for the Permission/Role schema fix, and real RBAC enforcement Aug 11, 2026
@tomchop
tomchop merged commit 713da38 into main Aug 11, 2026
@tomchop
tomchop deleted the fix/permission-role-schema-e2e branch August 12, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant