-
Notifications
You must be signed in to change notification settings - Fork 946
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
[backend] Fix UI issue when changing organization in a user (#7682) #8054
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8054 +/- ##
==========================================
+ Coverage 67.75% 68.09% +0.34%
==========================================
Files 572 572
Lines 71026 71080 +54
Branches 6047 6450 +403
==========================================
+ Hits 48122 48403 +281
+ Misses 22904 22677 -227 ☔ View full report in Codecov by Sentry. |
@@ -419,6 +419,11 @@ export const assignOrganizationToUser = async (context, user, userId, organizati | |||
if (!isUserHasCapability(user, SETTINGS_SET_ACCESSES) && isUserHasCapability(user, VIRTUAL_ORGANIZATION_ADMIN)) { | |||
throw ForbiddenAccess(); | |||
} | |||
const targetUser = await storeLoadById(context, user, userId, ENTITY_TYPE_USER); |
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 a concern about this assignOrganizationToUser, I wonder if we shouldn't use another method, or add more checks when the user is an organization admin (without SETTINGS_SET_ACCESSES).
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 think we should at least use findById method instead of storeLoadById which will do the right security checks.
But I also wonder if this method is usefull for an organization admin. To be checked with product team.
Proposed changes
Related issues
Checklist
Further comments