-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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-18088] Implement LimitItemDeletion permission checks for all cipher operations #5476
base: main
Are you sure you want to change the base?
[PM-18088] Implement LimitItemDeletion permission checks for all cipher operations #5476
Conversation
New Issues (6)Checkmarx found the following issues in this Pull Request
Fixed Issues (5)Great job! The following issues were fixed in this Pull Request
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5476 +/- ##
==========================================
+ Coverage 44.52% 44.61% +0.09%
==========================================
Files 1538 1538
Lines 70582 70667 +85
Branches 6316 6327 +11
==========================================
+ Hits 31426 31531 +105
+ Misses 37810 37786 -24
- Partials 1346 1350 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ce387d0
to
450f058
Compare
…re flag support - Add new method `CanDeleteOrRestoreCipherAsAdminAsync` in CiphersController - Update NormalCipherPermissions to support more flexible cipher type checking - Modify CipherService to use new permission checks with feature flag - Refactor test methods to support new permission logic - Improve authorization checks for organization cipher management
- Update CiphersController to use GetByIdAsync with userId - Modify NormalCipherPermissions to remove unnecessary type casting - Update ICipherService and CipherService method signatures to use CipherDetails - Remove redundant type checking in CipherService methods - Improve type consistency in cipher-related operations
…lag scenarios - Add test methods for DeleteAdmin with edit and manage permission checks - Implement tests for LimitItemDeletion feature flag scenarios - Update test method names to reflect more precise permission conditions - Improve test coverage for admin cipher deletion with granular permission handling
- Implement test methods for PutRestoreAdmin and PutRestoreManyAdmin - Add scenarios for owner and admin roles with LimitItemDeletion feature flag - Cover permission checks for manage and edit permissions - Enhance test coverage for single and bulk cipher restore admin operations - Verify correct invocation of RestoreAsync and RestoreManyAsync methods
…cking - Remove unnecessary assertions for null checks - Simplify mocking setup for cipher repository and service methods - Clean up redundant type and data setup in test methods - Improve test method clarity by removing extraneous code
…delete operations - Implement test methods for RestoreAsync with org admin override and LimitItemDeletion feature flag - Add scenarios for checking manage and edit permissions during restore operations - Extend test coverage for DeleteAsync with similar permission and feature flag checks - Enhance SoftDeleteAsync tests with org admin override and permission validation - Improve test method names to reflect precise permission conditions
8109339
to
01452d4
Compare
…delete operations - Extend test methods for RestoreManyAsync with various permission scenarios - Add test coverage for personal and organization ciphers in restore operations - Implement tests for RestoreManyAsync with LimitItemDeletion feature flag - Add detailed test scenarios for delete and soft delete operations - Improve test method names to reflect precise permission and feature flag conditions
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-18088
📔 Objective
Update
CipherService
andCiphersController
to enforce the newLimitItemDeletion
organization setting across all cipher operations when the feature flag is enabled.Apply permission checks to single and bulk operations for
Delete
,SoftDelete
, andRestore
.Refactor
CiphersController
to always retrieveCipherDetails
, as theManage
property onNormalCipherPermissions
must be checked whenLimitItemDeletion
is enabled.Add unit tests to verify the new logic and ensure existing functionality works correctly when the feature flag is disabled.
⏰ Reminders before review
🦮 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