-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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-13026] Refactor remove and bulkremove methods to throw error if user is managed by an organization #5034
base: main
Are you sure you want to change the base?
[PM-13026] Refactor remove and bulkremove methods to throw error if user is managed by an organization #5034
Conversation
… when account deprovisioning is enabled
…ate related logic.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5034 +/- ##
==========================================
+ Coverage 43.09% 43.13% +0.03%
==========================================
Files 1414 1414
Lines 64808 64851 +43
Branches 5925 5930 +5
==========================================
+ Hits 27929 27973 +44
Misses 35645 35645
+ Partials 1234 1233 -1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
New Issues
Fixed Issues
|
… remove unused logging method
src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/RemoveOrganizationUserCommand.cs
Outdated
Show resolved
Hide resolved
if (managementStatus.TryGetValue(orgUser.Id, out var isManaged) && isManaged) | ||
{ | ||
throw new BadRequestException("Managed members cannot be simply removed, their entire individual account must be deleted."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command is also used by SCIM which can continue to remove managed users (integrations are excluded from the delete behavior until we figure out how to do it safely). So there needs to be some conditionality here. Maybe stealing actingUser
from Jared's PR would be useful so it can encapsulate deletingUserId
or the SystemUser
(and in that case you can exempt SCIM from this check).
I don't love it but I think my problem is with the diverging business logic. Handling it in the command like this seems reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have refactored this so that we don't check managed users when an EventSystemUser
is passed.
…r-if-user-is-managed
…date retrieval and update unit tests accordingly
…r-if-user-is-managed
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-13026
📔 Objective
⏰ 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