Skip to content

Fix get policy by id endpoint and unify access in UI (#45048)#45132

Merged
lucasmrod merged 1 commit into
rc-minor-fleet-v4.85.0from
lucasmrod/fix-get-policy-by-id-cp
May 11, 2026
Merged

Fix get policy by id endpoint and unify access in UI (#45048)#45132
lucasmrod merged 1 commit into
rc-minor-fleet-v4.85.0from
lucasmrod/fix-get-policy-by-id-cp

Conversation

@lucasmrod
Copy link
Copy Markdown
Member

Cherry-pick for #45048.

**Related issue:** Resolves
#44949.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

- [X] Confirmed that the fix is not expected to adversely impact load
test results.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **Bug Fixes**
* Policy retrieval now correctly enforces team authorization, preventing
unauthorized cross-team access and ensuring team policies are returned
properly.

* **New Features**
* UI uses a unified policy access path for viewing/editing policies,
improving consistency for inherited/team-scoped policies,
back-navigation, and fleet-name display (All fleets / No team).

* **Tests**
* Added unit and integration tests covering cross-team access rules and
that policy automation fields are populated when policies are returned.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@lucasmrod lucasmrod requested review from a team as code owners May 11, 2026 12:57
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 62.00000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.87%. Comparing base (9de8af6) to head (9bcfc0d).
⚠️ Report is 35 commits behind head on rc-minor-fleet-v4.85.0.

Files with missing lines Patch % Lines
server/service/team_policies.go 27.27% 8 Missing and 8 partials ⚠️
server/service/policies.go 87.50% 1 Missing and 1 partial ⚠️
...policies/edit/components/PolicyForm/PolicyForm.tsx 90.90% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           rc-minor-fleet-v4.85.0   #45132      +/-   ##
==========================================================
+ Coverage                   66.72%   66.87%   +0.15%     
==========================================================
  Files                        2626     2600      -26     
  Lines                      211198   209478    -1720     
  Branches                     9428     9180     -248     
==========================================================
- Hits                       140924   140092     -832     
+ Misses                      57485    56596     -889     
- Partials                    12789    12790       +1     
Flag Coverage Δ
android ?
backend 68.59% <52.63%> (+0.09%) ⬆️
backend-activity ?
fleetd-chrome ?
frontend 54.95% <91.66%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lucasmrod lucasmrod merged commit 836b77b into rc-minor-fleet-v4.85.0 May 11, 2026
50 checks passed
@lucasmrod lucasmrod deleted the lucasmrod/fix-get-policy-by-id-cp branch May 11, 2026 13:17
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.

2 participants