[PR #1533] [MERGED] Move policy checks inside PolicyService #2947

Closed
opened 2025-11-26 23:26:17 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1533
Author: @eliykat
Created: 9/8/2021
Status: Merged
Merged: 9/23/2021
Merged by: @eliykat

Base: masterHead: policy-refactor


📝 Commits (6)

  • 66b2928 Move policy checks inside PolicyService
  • b210159 Merge branch 'master' into policy-refactor
  • b6e4b48 Remove leftover code
  • 4a805c8 Merge branch 'master' into policy-refactor
  • 269a182 Remove duplicate code
  • ff19e6c Reorder code for consistency

📊 Changes

5 files changed (+30 additions, -76 deletions)

View changed files

📝 src/Android/Autofill/AutofillService.cs (+4 -16)
📝 src/App/Pages/Vault/AddEditPageViewModel.cs (+8 -20)
📝 src/App/Utilities/AppHelpers.cs (+3 -26)
📝 src/Core/Models/Domain/Organization.cs (+1 -1)
📝 src/Core/Services/PolicyService.cs (+14 -13)

📄 Description

Objective

Mobile implementation of https://github.com/bitwarden/jslib/pull/466.

Code changes

  • PolicyService - add PolicyAppliesToUser. Note that this follows the same pattern as jslib after I tweaked it.
  • Organization - add isExemptFromPolicies getter
  • all other files - use PolicyAppliesToUser for all policy checks

Note that mobile does not have any concept of providers, so providers are not considered "owners" of orgs such that they are exempt from policies. If providers are not using the mobile app then this shouldn't matter.

Code freeze

A reminder to my future self.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1533 **Author:** [@eliykat](https://github.com/eliykat) **Created:** 9/8/2021 **Status:** ✅ Merged **Merged:** 9/23/2021 **Merged by:** [@eliykat](https://github.com/eliykat) **Base:** `master` ← **Head:** `policy-refactor` --- ### 📝 Commits (6) - [`66b2928`](https://github.com/bitwarden/android/commit/66b29284c66d715be2e6ee72ee72a1938229b293) Move policy checks inside PolicyService - [`b210159`](https://github.com/bitwarden/android/commit/b210159e8795dad6de255e1211d4674b10604e69) Merge branch 'master' into policy-refactor - [`b6e4b48`](https://github.com/bitwarden/android/commit/b6e4b4885462f085c6fb0784693e40df64283765) Remove leftover code - [`4a805c8`](https://github.com/bitwarden/android/commit/4a805c8a9e2ce64704d4ea4d5401ad43c541456d) Merge branch 'master' into policy-refactor - [`269a182`](https://github.com/bitwarden/android/commit/269a182efcee4c6cab5234edab0e059a0d3a095b) Remove duplicate code - [`ff19e6c`](https://github.com/bitwarden/android/commit/ff19e6c23b0f60203a5ecd3bd22732bc788ccf4d) Reorder code for consistency ### 📊 Changes **5 files changed** (+30 additions, -76 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Autofill/AutofillService.cs` (+4 -16) 📝 `src/App/Pages/Vault/AddEditPageViewModel.cs` (+8 -20) 📝 `src/App/Utilities/AppHelpers.cs` (+3 -26) 📝 `src/Core/Models/Domain/Organization.cs` (+1 -1) 📝 `src/Core/Services/PolicyService.cs` (+14 -13) </details> ### 📄 Description ## Objective Mobile implementation of https://github.com/bitwarden/jslib/pull/466. ## Code changes * `PolicyService` - add `PolicyAppliesToUser`. Note that this follows the same pattern as `jslib` after I tweaked it. * `Organization` - add `isExemptFromPolicies` getter * all other files - use `PolicyAppliesToUser` for all policy checks Note that mobile does not have any concept of providers, so providers are not considered "owners" of orgs such that they are exempt from policies. If providers are not using the mobile app then this shouldn't matter. ## Code freeze A reminder to my future self. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:26:17 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#2947