Skip to content

[PM-15970] Allow assigning collections if user has correct permissions #4461

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

Merged

Conversation

SaintPatrck
Copy link
Contributor

@SaintPatrck SaintPatrck commented Dec 12, 2024

🎟️ Tracking

PM-15970
PM-15969

📔 Objective

Allows assigning items to collections if the user has manage permissions and is not restricted from viewing or editing password in the collection. This fixes an issue where collection assignment would be blocked if the user could view the item and its passwords.

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

github-actions bot commented Dec 12, 2024

Logo
Checkmarx One – Scan Summary & Detailsb65ad2a8-1091-4a22-aff9-3486e51f4c2c

No New Or Fixed Issues Found

@SaintPatrck SaintPatrck force-pushed the PM-15970/view-permission-can-move-move-collections branch from 5ac1b7c to b695954 Compare December 13, 2024 22:15
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dseverns-livefront @david-livefront This seemed like the best package for the enum, but I'm open to suggestion if there's a more appropriate place.

Copy link
Collaborator

Choose a reason for hiding this comment

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

makes sense to me, another thought I had was: if we are not using this outside the extensions it could live in that file and maybe annotate with @VisibleForTesting so if we were to try and use it outside there or the test we get a lint warning, but that may be more philosophical.

TLDR: Placement makes sense to me.

readOnly && hidePasswords -> CollectionPermission.VIEW_EXCEPT_PASSWORDS
readOnly -> CollectionPermission.VIEW
!readOnly && hidePasswords -> CollectionPermission.EDIT_EXCEPT_PASSWORD
// !readOnly is the only other possible condition, which resolves to EDIT permission
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@dseverns-livefront dseverns-livefront left a comment

Choose a reason for hiding this comment

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

Just a small typo and a visibility option. But otherwise LGTM!

Allows assigning items to collections if the user has manage permissions and is not restricted from viewing or editing password in the collection. This fixes an issue where collection assignment would be blocked if the user could view the item and its passwords.
@SaintPatrck SaintPatrck force-pushed the PM-15970/view-permission-can-move-move-collections branch from ed2e234 to 5f9ca1a Compare December 19, 2024 18:44
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.91%. Comparing base (3329dfa) to head (5f9ca1a).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
.../ui/vault/feature/util/CollectionViewExtensions.kt 82.35% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4461      +/-   ##
==========================================
- Coverage   88.91%   88.91%   -0.01%     
==========================================
  Files         455      455              
  Lines       39558    39568      +10     
  Branches     5605     5614       +9     
==========================================
+ Hits        35173    35180       +7     
  Misses       2428     2428              
- Partials     1957     1960       +3     

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

Copy link
Collaborator

@dseverns-livefront dseverns-livefront left a comment

Choose a reason for hiding this comment

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

@SaintPatrck SaintPatrck added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 35e8cec Dec 20, 2024
8 checks passed
@SaintPatrck SaintPatrck deleted the PM-15970/view-permission-can-move-move-collections branch December 20, 2024 17:55
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