-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
fix(manage): sync dev role attach/detach with legacy permissions value #2878
base: master
Are you sure you want to change the base?
fix(manage): sync dev role attach/detach with legacy permissions value #2878
Conversation
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 many reservations about this implementation. If a Moderator applies for Jr. Dev, they'll automatically have their Permissions lowered. Similarly, if they give up being a developer, they'll get reset to Registered.
It probably makes sense to keep these changes, but only apply them for users under Moderator permissions level.
I believe this should now be done in latest. The role attach/detach is still in place for all users as before, but permissions are not reassigned unless |
Role::DEVELOPER_RETIRED, | ||
])) { | ||
return; | ||
} |
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.
Having this as a secondary gate duplicates the lower logic and creates an opportunity for them to become desync'd. Suggest adding an else return
to the logic below:
else
{
// nothing to synchronize for non-developer roles. we're done
return;
}
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.
Addressed in latest.
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 you missed my point. You're still checking the conditions twice.
Instead of:
if (in_array(A, B)) {
if (A) {
} elseif (B) {
}
do_stuff();
}
just do:
if (A) {
} elseif (B) {
} else {
return;
}
do_stuff();
Resolves an issue where attaching/detaching developer roles from the management app does not synchronize that user's legacy
Permissions
value.In other words, you can attach a Junior Developer role, but their permissions value won't be automatically updated to 2.
After deploy, run: