Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-13360] Respect manage permission to assign collections #4190

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

SaintPatrck
Copy link
Contributor

🎟️ Tracking

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

📔 Objective

This commit prevents users from assigning items to collections if the item is already in a read-only collection where the user does not have "manage" permission.

This change ensures that users with limited permissions cannot modify items in a way that violates the collection's access controls.

📸 Screenshots

Coming soon!

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation 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

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 51.28205% with 19 lines in your changes missing coverage. Please review.

Project coverage is 88.99%. Comparing base (87d324b) to head (7e1e8d3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../ui/vault/feature/addedit/VaultAddEditViewModel.kt 35.71% 0 Missing and 9 partials ⚠️
...warden/ui/vault/feature/item/VaultItemViewModel.kt 40.00% 0 Missing and 9 partials ⚠️
...bitwarden/ui/vault/feature/item/VaultItemScreen.kt 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4190      +/-   ##
==========================================
- Coverage   89.02%   88.99%   -0.04%     
==========================================
  Files         445      445              
  Lines       38819    38850      +31     
  Branches     5440     5458      +18     
==========================================
+ Hits        34558    34573      +15     
  Misses       2368     2368              
- Partials     1893     1909      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SaintPatrck SaintPatrck force-pushed the PM-12922/delete-collection-permission branch 3 times, most recently from 17d36f0 to 9850607 Compare October 29, 2024 22:25
@SaintPatrck SaintPatrck force-pushed the PM-13360/collection-association-permission branch from 9d8e0f0 to 76954d4 Compare October 30, 2024 15:19
@SaintPatrck SaintPatrck force-pushed the PM-12922/delete-collection-permission branch 4 times, most recently from 4d2f1c2 to 70a7e99 Compare October 31, 2024 14:29
@SaintPatrck SaintPatrck force-pushed the PM-13360/collection-association-permission branch from 76954d4 to e89cc11 Compare November 6, 2024 22:01
Copy link
Contributor

github-actions bot commented Nov 6, 2024

Logo
Checkmarx One – Scan Summary & Details1e5791df-dda2-4808-9f7c-a2db9a86a4c0

No New Or Fixed Issues Found

Base automatically changed from PM-12922/delete-collection-permission to main November 7, 2024 00:03
This commit prevents users from assigning items to collections if the item is already in a read-only collection where the user does not have "manage" permission.

This change ensures that users with limited permissions cannot modify items in a way that violates the collection's access controls.
@SaintPatrck SaintPatrck force-pushed the PM-13360/collection-association-permission branch from e89cc11 to 7e1e8d3 Compare November 7, 2024 16:09
@@ -7,9 +7,12 @@ import com.bitwarden.vault.CipherView
*
* @property cipher The cipher view for the item.
* @property totpCodeItemData The data for the totp code.
* @property canDelete Whether the item can be deleted.
* @property canAssociateToCollections Whether the item can be associated to a collection.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SaintPatrck SaintPatrck added this pull request to the merge queue Nov 7, 2024
Merged via the queue into main with commit 7ccba88 Nov 7, 2024
9 checks passed
@SaintPatrck SaintPatrck deleted the PM-13360/collection-association-permission branch November 7, 2024 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants