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-13349] Hide edit button unless item is in at least one non-readOnly collection #4430

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mpbw2
Copy link
Contributor

@mpbw2 mpbw2 commented Dec 6, 2024

Hide edit button unless item is in at least one non-readOnly collection

🎟️ Tracking

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

📔 Objective

Hide the edit button (FAB) if an item is in a readOnly collection, or in the case of multiple collections at least one has to be non-readOnly or the button remains hidden.

📸 Screenshots

Item view from within non-readOnly (editable) collection:

Screenshot 2024-12-06 at 4 33 20 PM

Item view from within readOnly (non-editable) collection:

Screenshot 2024-12-06 at 4 32 54 PM

⏰ 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
Contributor

github-actions bot commented Dec 6, 2024

Logo
Checkmarx One – Scan Summary & Details975f7725-eccc-4180-8c9b-66288c48fab8

Fixed Issues

Severity Issue Source File / Package
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt: 886

SaintPatrck
SaintPatrck previously approved these changes Dec 9, 2024
Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

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

The server evaluates this business logic for you and sets the result in the cipher.edit property.

  • true if the user can edit the item
  • false if the item is read-only

This takes into account whether it's in the user's individual vault vs. organization (and if organization, what collection permissions apply).

I'm not familiar with mobile, but it looks like it's available on the SDK model: https://github.com/bitwarden/sdk-internal/blob/main/crates/bitwarden-vault/src/cipher/cipher.rs#L82

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.

Project coverage is 88.92%. Comparing base (c4c7af5) to head (23e4a9e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...warden/ui/vault/feature/item/VaultItemViewModel.kt 37.50% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4430      +/-   ##
==========================================
- Coverage   88.93%   88.92%   -0.02%     
==========================================
  Files         459      459              
  Lines       39820    39828       +8     
  Branches     5632     5637       +5     
==========================================
+ Hits        35413    35416       +3     
  Misses       2440     2440              
- Partials     1967     1972       +5     

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

@mpbw2
Copy link
Contributor Author

mpbw2 commented Dec 20, 2024

The server evaluates this business logic for you and sets the result in the cipher.edit property.

Thanks for the heads up on this @eliykat

@mpbw2 mpbw2 requested a review from SaintPatrck December 20, 2024 19:30
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.

3 participants