[PR #6089] [MERGED] [PM-27120] cxp hide user account when remove individual export is enabled #36805

Closed
opened 2026-04-21 03:55:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6089
Author: @aj-rosado
Created: 10/28/2025
Status: Merged
Merged: 10/31/2025
Merged by: @aj-rosado

Base: mainHead: PM-27120/cxp-hide-user-account-remove-individual-export


📝 Commits (8)

  • 4930211 Saving account exportable info into UserState
  • 1c54be9 fixed tests for UserState changes
  • ccd86dc Added tests to PolicyManager and UserStateJsonExtenstions changes related to isExportable behaviour
  • a554471 addressed PR comments
  • 73bfa25 added comments clarifying changes
  • 50d054d Simplified UserStateJsonExtension isExportable validation
  • cb0728c checking if policy is enabled on UserstateJsonExtensions
  • f5dc13a fixed formatting

📊 Changes

50 files changed (+553 additions, -43 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/UserStateManagerImpl.kt (+14 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/di/AuthRepositoryModule.kt (+2 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/model/UserState.kt (+1 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt (+17 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/PolicyManager.kt (+8 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/PolicyManagerImpl.kt (+12 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultSyncManagerImpl.kt (+9 -6)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt (+1 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt (+3 -2)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/ExportItemsNavigation.kt (+5 -2)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountNavigation.kt (+1 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountScreen.kt (+2 -2)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountViewModel.kt (+7 -13)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/verifypassword/VerifyPasswordNavigation.kt (+8 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/verifypassword/VerifyPasswordViewModel.kt (+1 -5)
📝 app/src/test/kotlin/com/x8bit/bitwarden/MainViewModelTest.kt (+1 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/UserStateManagerTest.kt (+48 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt (+269 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/credentials/processor/CredentialProviderProcessorTest.kt (+1 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/PolicyManagerTest.kt (+56 -0)

...and 30 more files

📄 Description

🎟️ Tracking

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

📔 Objective

Hide the accounts that contain an organization that does not allow Individual vault export on the Account Selector.

In order to achieve that and to ensure skipping the selection screen, when taking into consideration accounts that cannot export, some changes were needed to make

Saving account exportable info into UserState (in order to RootNav know which screen to navigate to)
Added getUserPolicies to PolicyManager that will return all the policies associated with the given userId (in order to get data for the iven userId and not only the current active)

VaultSyncManager re ordered to ensure when UserState is updated policies are also updated
SelectAccount verifying if account isExportable
Added more info to VerifyPasswordNavigation in order to properly know when to display the back button.

📸 Screenshots

Two accounts scenario

https://github.com/user-attachments/assets/9bd6f84e-c942-4d20-8cee-1c7606366b41

More than two accounts

https://github.com/user-attachments/assets/9a7e3941-5c6c-4ef0-b273-7de5b3439e85

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 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/6089 **Author:** [@aj-rosado](https://github.com/aj-rosado) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 10/31/2025 **Merged by:** [@aj-rosado](https://github.com/aj-rosado) **Base:** `main` ← **Head:** `PM-27120/cxp-hide-user-account-remove-individual-export` --- ### 📝 Commits (8) - [`4930211`](https://github.com/bitwarden/android/commit/493021122907e548fd1686020e9b77c24a4cc6c8) Saving account exportable info into UserState - [`1c54be9`](https://github.com/bitwarden/android/commit/1c54be9b267fc3178a3ee2737cc79557edff0f8a) fixed tests for UserState changes - [`ccd86dc`](https://github.com/bitwarden/android/commit/ccd86dc659706a4b65a1265c53c13fbd379f8ce9) Added tests to PolicyManager and UserStateJsonExtenstions changes related to isExportable behaviour - [`a554471`](https://github.com/bitwarden/android/commit/a554471efc554bd57c10a1403fd66922e3fe7e5f) addressed PR comments - [`73bfa25`](https://github.com/bitwarden/android/commit/73bfa2561476aa2d68102a2abcdafc2b9453f181) added comments clarifying changes - [`50d054d`](https://github.com/bitwarden/android/commit/50d054d8ec753b1f3ee1484e34490ebffc343f75) Simplified UserStateJsonExtension isExportable validation - [`cb0728c`](https://github.com/bitwarden/android/commit/cb0728c954b64d2ca912a4474439a6e76e284b38) checking if policy is enabled on UserstateJsonExtensions - [`f5dc13a`](https://github.com/bitwarden/android/commit/f5dc13af1e5b56f4edf5b61a16f5870b9a0d2759) fixed formatting ### 📊 Changes **50 files changed** (+553 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/manager/UserStateManagerImpl.kt` (+14 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/di/AuthRepositoryModule.kt` (+2 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/model/UserState.kt` (+1 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt` (+17 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/PolicyManager.kt` (+8 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/PolicyManagerImpl.kt` (+12 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultSyncManagerImpl.kt` (+9 -6) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt` (+1 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt` (+3 -2) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/ExportItemsNavigation.kt` (+5 -2) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountNavigation.kt` (+1 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountScreen.kt` (+2 -2) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/selectaccount/SelectAccountViewModel.kt` (+7 -13) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/verifypassword/VerifyPasswordNavigation.kt` (+8 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/verifypassword/VerifyPasswordViewModel.kt` (+1 -5) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/MainViewModelTest.kt` (+1 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/manager/UserStateManagerTest.kt` (+48 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt` (+269 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/credentials/processor/CredentialProviderProcessorTest.kt` (+1 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/PolicyManagerTest.kt` (+56 -0) _...and 30 more files_ </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-27120 ## 📔 Objective Hide the accounts that contain an organization that does not allow Individual vault export on the Account Selector. In order to achieve that and to ensure skipping the selection screen, when taking into consideration accounts that cannot export, some changes were needed to make Saving account exportable info into UserState (in order to RootNav know which screen to navigate to) Added getUserPolicies to PolicyManager that will return all the policies associated with the given userId (in order to get data for the iven userId and not only the current active) VaultSyncManager re ordered to ensure when UserState is updated policies are also updated SelectAccount verifying if account isExportable Added more info to VerifyPasswordNavigation in order to properly know when to display the back button. ## 📸 Screenshots ### Two accounts scenario https://github.com/user-attachments/assets/9bd6f84e-c942-4d20-8cee-1c7606366b41 ### More than two accounts https://github.com/user-attachments/assets/9a7e3941-5c6c-4ef0-b273-7de5b3439e85 ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <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 2026-04-21 03:55:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#36805