Repository navigation
feat(company-os): company-scoped team routes for owners and admins (#14106) - #20565
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…issue-14106-company-team-routes
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
…he Teams screen (#14106)
|
Code review on PR #20565 (head 1272119): approve of the routes; the screen's writes get a fresh look when they join this PR. Read only; nothing was run, and the generated types weren't checked. All four routes check tenant then owner-or-admin before writing; another company's team is a 404; add refuses a user outside the company; delete is a soft delete, audited. Low: |
Auto-sync: merging
|
| side | commit | subject | issue refs |
|---|---|---|---|
| main | d80ec1c8b |
fix(train): reach floors return to mid-window on the merged tree (#20251) | #20251 |
| this branch | 088811b8e |
fix(frontend): re-pin the reach floors this branch moved (#18245) | #18245 |
repo_tests/vnc_password_not_in_frontend_source_16299_test.py
| side | commit | subject | issue refs |
|---|---|---|---|
| main | d80ec1c8b |
fix(train): reach floors return to mid-window on the merged tree (#20251) | #20251 |
| this branch | 088811b8e |
fix(frontend): re-pin the reach floors this branch moved (#18245) | #18245 |
…14106) # Conflicts: # repo_tests/i18n_untranslated_ratchet_test.py # repo_tests/undefined_css_var_ratchet_17552_test.py # repo_tests/vnc_password_not_in_frontend_source_16299_test.py
…th land in order (#14106)
|
Code review on PR #20565 (head b524614): APPROVE Delta since the reviewed head 05b98a4:
|
Thinking Path
A maintainer decision says a company's owner or admin manages its own teams. Team writes only existed on routes for platform admins with the organisation taken from ambient context, so company-scoped routes are needed, with the scope from the path.
What Changed
llc/api/company_teams.py: create and delete a team, add and remove a member, under/api/llc/companies/{company_id}/teams. They call the existingTeamServiceand response builders, with no second implementation.assert_company_access, thenrequire_company_admin_unless_platform. An added user must belong to the company. Another company's team is a 404.TeamServicewrites the audit rows. Delete is the same soft delete, with no automatic cleanup.Verification
test_company_teams_14106.pywithtest_membership_policy_19654.py: 55 passed, covering owner and admin, refusals with no commit or audit row, cross-company and outside-user cases. Database lookups are patched, so real rows are untested.verify-generated-typescovers that.Notes
TeamService.create_teammakes the caller team owner, so a platform admin who is not a company member would own the team.useCompanyTeams.tsandTeamsView.vue, with a confirmed delete. No response says whether the caller may manage, so controls show to anyone who can read, and a member sees the refusal text.TeamsView.writes.test.ts: 12 passed withreka-uistubbed. Not seen rendered; the real select is untested.Model Used
Claude Sonnet for the implementation, Claude Opus for coordination.
Closes #14106