[PR #1166] [MERGED] [Policy] Personal Ownership #2777

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1166
Author: @vincentsalucci
Created: 12/4/2020
Status: Merged
Merged: 12/14/2020
Merged by: @vincentsalucci

Base: masterHead: m-personal-ownership


📝 Commits (6)

  • ced1a56 Initial commit of personal ownership policy
  • 9a4502e Updated logic for returning from allowing cipher creation from notification
  • 409fc09 Merge branch 'master' into m-personal-ownership
  • 212bff4 Merge branch 'master' into m-personal-ownership
  • e27cca1 fixed small edge case when user in one org // adjusted error message to match all platforms
  • 916fff8 Removed test code

📊 Changes

8 files changed (+74 additions, -1 deletions)

View changed files

📝 src/Android/Autofill/AutofillService.cs (+22 -0)
📝 src/App/Pages/Vault/AddEditPageViewModel.cs (+36 -0)
📝 src/App/Resources/AppResources.Designer.cs (+6 -0)
📝 src/App/Resources/AppResources.resx (+3 -0)
📝 src/Core/Enums/PolicyType.cs (+2 -1)
📝 src/Core/Models/Data/OrganizationData.cs (+2 -0)
📝 src/Core/Models/Domain/Organization.cs (+2 -0)
📝 src/Core/Models/Response/ProfileOrganizationResponse.cs (+1 -0)

📄 Description

Objective

Allow organizations to restrict user's from saving added/cloned items to their personal vaults. Remove the personal ownership option when this policy is enabled and the user is not an Admin/Owner of the organization.

Code Changes

  • Android/AutofillService: Added checks to prevent user's from being able to auto-fill/save new logins (defaults to personal ownership, otherwise)
  • AddEditPageViewModel: Added PolicyService to constructor. Added logic during construction of personal ownership list to remove the personal ownership option if necessary. Note: ran into a special use case where the list of collections was not being updated when defaulting to an organization because of the personal ownership policy. If the OwnershipOrgIndex remained at position 0, the change detection would not occur: Forced a refresh if specific condition met. Added check during submit to make sure the user didn't select personal ownership when not available.
  • AppResource: Added error message
  • PolicyType: Added PersonalOwnership policy type
  • OrganizationData: Added UsePolicies
  • Organization: Added UsePolicies
  • ProfileOrganizationResponse: Added UsePolicies

Screenshots

0-list
1-error


🔄 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/1166 **Author:** [@vincentsalucci](https://github.com/vincentsalucci) **Created:** 12/4/2020 **Status:** ✅ Merged **Merged:** 12/14/2020 **Merged by:** [@vincentsalucci](https://github.com/vincentsalucci) **Base:** `master` ← **Head:** `m-personal-ownership` --- ### 📝 Commits (6) - [`ced1a56`](https://github.com/bitwarden/android/commit/ced1a5680180e46184bc6090b64300f9cefe0406) Initial commit of personal ownership policy - [`9a4502e`](https://github.com/bitwarden/android/commit/9a4502e887889ee919072e6d9377ccbd8b997522) Updated logic for returning from allowing cipher creation from notification - [`409fc09`](https://github.com/bitwarden/android/commit/409fc09f8346ab2976e129b5f009b0c54a1ef905) Merge branch 'master' into m-personal-ownership - [`212bff4`](https://github.com/bitwarden/android/commit/212bff41490789b4d7aeceaf30451196243d8216) Merge branch 'master' into m-personal-ownership - [`e27cca1`](https://github.com/bitwarden/android/commit/e27cca1e12e81eb87c065d61ac52c0381bd9335b) fixed small edge case when user in one org // adjusted error message to match all platforms - [`916fff8`](https://github.com/bitwarden/android/commit/916fff8cbe19bd7d4da8e2be2a07561f19215b9a) Removed test code ### 📊 Changes **8 files changed** (+74 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Autofill/AutofillService.cs` (+22 -0) 📝 `src/App/Pages/Vault/AddEditPageViewModel.cs` (+36 -0) 📝 `src/App/Resources/AppResources.Designer.cs` (+6 -0) 📝 `src/App/Resources/AppResources.resx` (+3 -0) 📝 `src/Core/Enums/PolicyType.cs` (+2 -1) 📝 `src/Core/Models/Data/OrganizationData.cs` (+2 -0) 📝 `src/Core/Models/Domain/Organization.cs` (+2 -0) 📝 `src/Core/Models/Response/ProfileOrganizationResponse.cs` (+1 -0) </details> ### 📄 Description ## Objective > Allow organizations to restrict user's from saving added/cloned items to their personal vaults. Remove the personal ownership option when this policy is enabled and the user is not an Admin/Owner of the organization. ## Code Changes - **Android/AutofillService**: Added checks to prevent user's from being able to auto-fill/save new logins (defaults to personal ownership, otherwise) - **AddEditPageViewModel**: Added `PolicyService` to constructor. Added logic during construction of personal ownership list to remove the personal ownership option if necessary. **Note**: ran into a special use case where the list of collections was not being updated when defaulting to an organization because of the personal ownership policy. If the `OwnershipOrgIndex` remained at position 0, the change detection would not occur: Forced a refresh if specific condition met. Added check during submit to make sure the user didn't select personal ownership when not available. - **AppResource**: Added error message - **PolicyType**: Added `PersonalOwnership` policy type - **OrganizationData**: Added `UsePolicies` - **Organization**: Added `UsePolicies` - **ProfileOrganizationResponse**: Added `UsePolicies` ## Screenshots ![0-list](https://user-images.githubusercontent.com/26154748/102019959-e5a39580-3d3b-11eb-952d-70c63181b316.png) ![1-error](https://user-images.githubusercontent.com/26154748/102019960-e6d4c280-3d3b-11eb-92a5-698ed93e8124.png) --- <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:23:58 -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#2777