Skip to content

[PM-40350] ManagePolicies should allow read-only access to claimed organization domains - #8220

Merged
harr1424 merged 2 commits into
mainfrom
tools/PM-40350-ManagePolicies-should-allow-read-access-claimed-domains
Aug 20, 2026
Merged

[PM-40350] ManagePolicies should allow read-only access to claimed organization domains#8220
harr1424 merged 2 commits into
mainfrom
tools/PM-40350-ManagePolicies-should-allow-read-access-claimed-domains

Conversation

@harr1424

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-40350

📔 Objective

This PR modifies policy gated logic to allow users having the ManagePolicies role to access a read-only endpoint and enumerate claimed domains for organizations they belong to and have been granted this role on behalf of.

This is necessary so that the Send Policy edit dialog populates domains claimed by an organization, and is a proper fix compared to the previous bandaid.

@harr1424
harr1424 requested a review from a team as a code owner August 16, 2026 16:37
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the authorization change to GetAll on OrganizationDomainController, which now permits either ManageSso or ManagePolicies for this read-only endpoint, plus the accompanying unit test. Permission checks still precede the organization existence lookup, so the endpoint does not leak org existence to unauthorized callers, and ManagePolicies resolves through the same OrganizationAdmin OR custom-permission path used by ManageSso. The response exposes only organization-scoped domain claim data (domain name, DNS TXT verification value, verification timestamps) to a role already scoped to that organization, so no zero-knowledge or vault-data boundary is affected. Write paths (Post, Verify, RemoveDomain) remain gated on ManageSso via ValidateOrganizationAccessAsync, and the existing negative test still passes since the unconfigured ManagePolicies substitute returns false.

Code Review Details

No findings at or above the reporting threshold. Minor observation not worth an inline comment: the new inline check duplicates the organization existence lookup already in ValidateOrganizationAccessAsync, which could be parameterized if more endpoints need mixed permissions.

@harr1424 harr1424 changed the title add ManagePolicies to GetAll endpoint and update tests [PM-40350] ManagePolicies allows read-only access to claimed organization domains Aug 16, 2026
@harr1424 harr1424 changed the title [PM-40350] ManagePolicies allows read-only access to claimed organization domains [PM-40350] ManagePolicies should allow read-only access to claimed organization domains Aug 16, 2026
@harr1424 harr1424 added needs-qa t:bugfix Change Type - Bugfix labels Aug 16, 2026
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.27%. Comparing base (c93bbb7) to head (c63f029).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8220   +/-   ##
=======================================
  Coverage   63.27%   63.27%           
=======================================
  Files        2383     2383           
  Lines      103919   103925    +6     
  Branches     9408     9410    +2     
=======================================
+ Hits        65753    65759    +6     
  Misses      35916    35916           
  Partials     2250     2250           

☔ View full report in Codecov by Harness.
📢 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.

@harr1424 harr1424 removed the needs-qa label Aug 20, 2026
@harr1424
harr1424 merged commit bb7b503 into main Aug 20, 2026
76 of 82 checks passed
@harr1424
harr1424 deleted the tools/PM-40350-ManagePolicies-should-allow-read-access-claimed-domains branch August 20, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t:bugfix Change Type - Bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants