Skip to content

Support staff see support projects in every list across projects (OFN-4816) - #5301

Merged
midigofrank merged 1 commit into
v3from
ofn-4816-support
Dec 4, 2026
Merged

midigofrank merged 1 commit into
v3from
ofn-4816-support

Conversation

@midigofrank

Copy link
Copy Markdown
Contributor

A support user could open any project with allow_support_access, but the API listed only the projects they were a member of, so the new front end couldn't find a support project except by its id.

  • Projects.visible_project_ids/1 now gives a support user every project with allow_support_access, sandboxes included, as Scope lets them open each. Every list across projects reads it: GET /api/projects and /api/v3/projects (live, top-level ones), and the workflows, jobs, runs, work orders and log lines lists. v2 changes too; that's deliberate and matches the dashboard.
  • GET /api/v3/me/memberships lists one membership per project in the projects list. A project reached by support access alone answers with role: "support", the project's id as id, and abilities from the policy (can_edit_workflows and can_run true today). A membership row wins over support access.
  • OpenAPI: support is added only to the /me/memberships role enum; the include=members role is unchanged.

Client side: OpenFn/lightning-ui#166 (MyRole).

Not done

  • The cross-project lists don't check MFA, for members or support users. A support user without MFA now sees rows from every support project that requires it, where before it was only their own projects.

…-4816)

visible_project_ids/1 gives a support user their member projects plus
every project with allow_support_access, sandboxes included, as Scope lets
them open each. Every list across projects reads it, so the projects list
(v2 and v3) and the workflows, jobs, runs, work orders and log lines lists
all widen for support users, matching the dashboard.

/api/v3/me/memberships lists one membership in each project the projects
list gives. A project reached by support access alone answers with role
support and the project's id as its id, since there is no project_users
row; abilities come from the policy as before. A row wins over support
access.
@github-project-automation github-project-automation Bot moved this to New Issues in Core Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Security Review ✅

  • S0 (project scoping): New visible_project_ids/1 clause at lib/lightning/projects.ex:1148 filters on p.allow_support_access and unions with member projects; support_user? comes from the authenticated user (lib/lightning/scope.ex:130), not from a param, and every downstream list (workflows/runs/work orders/log lines) already reads this helper.
  • S1 (authorization): No new web-layer actions; paginate_memberships_for/2 at lib/lightning/projects.ex:1264 only broadens listing — opening each project still goes through openable/2 → :access_project, which ProjectUsers.judge/2 grants via Scope.has_standing? only when support? (support_user flag AND allow_support_access) is true.
  • S2 (audit trail): N/A — the diff is read-only (list query + API presentation), no config-resource writes.

@midigofrank
midigofrank merged commit 090f5db into v3 Dec 4, 2026
6 of 7 checks passed
@midigofrank
midigofrank deleted the ofn-4816-support branch December 4, 2026 11:43
@github-project-automation github-project-automation Bot moved this from New Issues to Done in Core Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant