Add executive_director relation to project FGA type#132
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughBumped OpenFGA model minor version from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Updates the OpenFGA authorization model used by the lfx-platform Helm chart to align the model with relations being written by backend services (notably project#executive_director).
Changes:
- Add
project#executive_directorrelation and grant it transitive access by including it inproject#auditor. - Update the
vote_responsetype relations (addsproject,writer,viewer) as part of the same model change.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
charts/lfx-platform/templates/openfga/model.yaml (1)
21-24:⚠️ Potential issue | 🟠 MajorBump the authorization model version.
This PR adds new relations, but the model version stays
10.0.0. The note in this file says relation additions require a minor bump; without that, existing environments can keep the old model and never pick up the newexecutive_directorandvote_responserelations.🔧 Proposed change
- version: major: 10 - minor: 0 + minor: 1 patch: 0🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@charts/lfx-platform/templates/openfga/model.yaml` around lines 21 - 24, The model version block currently lists major: 10, minor: 0, patch: 0 but new relations (executive_director and vote_response) require a minor version bump; update the version mapping in the model.yaml (the version / major / minor / patch keys) to increment the minor version (e.g., set minor: 1 and patch: 0, keeping major: 10) so environments will pick up the new relations.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@charts/lfx-platform/templates/openfga/model.yaml`:
- Around line 21-24: The model version block currently lists major: 10, minor:
0, patch: 0 but new relations (executive_director and vote_response) require a
minor version bump; update the version mapping in the model.yaml (the version /
major / minor / patch keys) to increment the minor version (e.g., set minor: 1
and patch: 0, keeping major: 10) so environments will pick up the new relations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 61b88374-3c74-4475-8fb4-92e808c65846
📒 Files selected for processing (1)
charts/lfx-platform/templates/openfga/model.yaml
ae6be8e to
c1b500a
Compare
Review Feedback AddressedCommits: 0b3e1ac (rebased executive_director onto main), c1b500a (version bump) Changes Made
Threads Resolved2 of 2 unresolved threads addressed. |
Reserve 10.1.0 for executive_director changes (PR #132). vote_response relation additions land as 10.2.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1555 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Add executive_director as a named user relation on project and include it in auditor, granting executive directors auditor and viewer access transitively. Fixes 51 failed batch writes per reconciliation cycle caused by the relation not existing in the OpenFGA model. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1556 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Adding executive_director relation requires a minor bump. 10.1.0 was taken by the LFXV2-1431 audit fix (PR #127). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1556 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
c1b500a to
6117aa2
Compare
There was a problem hiding this comment.
Pull request overview
Updates the OpenFGA authorization model for the project type to support tuples written by project-service for executive directors, preventing validation failures during reconciliation and ensuring access is computed correctly.
Changes:
- Bumps the OpenFGA model version from
10.1.0to10.2.0to trigger reconciliation. - Adds a new
project#executive_directorrelation ([user]). - Extends
project#auditorto includeexecutive_director, granting executive directors auditor (and therefore viewer) access.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reserve 10.1.0 for executive_director changes (PR #132). vote_response relation additions land as 10.2.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1555 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Adding writer relation to vote_response requires a minor bump. 10.2.0 is reserved for executive_director (PR #132). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1555 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Summary
Adds
executive_directoras a named user relation on theprojectOpenFGA type and includes it inauditor, granting executive directors auditor → viewer access transitively.Problem
The project-service assigns
executive_directortuples to project objects, but this relation didn't exist in the model:This caused 51 failed batch writes per reconciliation cycle, leaving affected projects with no FGA tuples (no
viewer, noparent).Change
type project relations define parent: [project] define owner: [team#member] or owner from parent define writer: [user] or owner or writer from parent - define auditor: [user, team#member] or writer or auditor from parent + define auditor: [user, team#member] or executive_director or writer or auditor from parent # The meeting_coordinator relation identifies a user who can manage any meeting # for a given project. define meeting_coordinator: [user] + # executive_director identifies a user with the executive director role for a project, + # as assigned by the project-service. executive_directors are auditors of the project. + define executive_director: [user] define viewer: [user:*] or auditor or auditor from parentRelated
Closes LFXV2-1556