[PM-40248] feat: Enforce Send access controls via Send Controls policy - #2906
[PM-40248] feat: Enforce Send access controls via Send Controls policy#2906matt-livefront wants to merge 3 commits into
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the enforcement of the Send Controls policy's access-control option ( Code Review Details
Notes considered and cleared during review:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2906 +/- ##
==========================================
- Coverage 79.38% 79.37% -0.01%
==========================================
Files 1172 1172
Lines 74875 74950 +75
==========================================
+ Hits 59438 59492 +54
- Misses 15437 15458 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
922747c to
c47e0a2
Compare
| extension [Policy] { | ||
| /// The policy with the earliest revision date, or `nil` if the list is empty. | ||
| /// | ||
| var earliestRevisionDate: Policy? { |
There was a problem hiding this comment.
🎨 SUGGESTED: Property name reads as a Date but returns a Policy.
Details and fix
At the call sites this reads as if a date is being returned: policies.earliestRevisionDate?.organizationId (PolicyService.swift:515) and policies.earliestRevisionDate assigned to domainsPolicy (SendPolicyOptions.swift:45). Naming it after the returned type keeps the read accurate:
| var earliestRevisionDate: Policy? { | |
| var policyWithEarliestRevisionDate: Policy? { |
The original private helper it replaced (policyWithEarliestRevisionDate(from:)) carried this clarity; not required, just easier to read at the call site.
fedemkr
left a comment
There was a problem hiding this comment.
Looks good, the only ⛏️ is what Claude is suggesting for the name of the property.
| title: Localizations.invalidEmailAddresses, | ||
| message: Localizations.onlyIncludeTheFollowingDomainsDescriptionLong( | ||
| allowedDomains.joined(separator: ", "), | ||
| allowedDomains.formatted(.list(type: .and, width: .narrow)), |
🎟️ Tracking
PM-40248
📔 Objective
Enforce the Send Controls policy's access control option (
whoCanAccess) on iOS, behind thepm-31885-send-controlsfeature flag. When an organization requires a specific access option, the Send add/edit "Who can view" menu shows the enforced value and is disabled, and the required option is forced:whoCanAccess = 1) → access type forced to Anyone with a password, and a password is required to save.whoCanAccess = 2) → access type forced to Specific people, and at least one recipient email is required to save.0) / flag off / no applying policy → no change to existing behavior.📸 Screenshots