Owner removal check incorrect when role is removed from user #2614
Labels
Feature - Teams SSO
Issue type - bug
Bugs in existing code that needs to be fixed.
Plugin - local_o365
Status - PR ready / pending release
Dev is done and PR ready. Will be included in the next release.
Milestone
When a user's role assignment is changed, the plugin currently checks whether the user is currently an owner of the team using in_array to determine whether the user has been demoted to a normal member (e.g. transitioned from a teacher to student).
However, the
get_group_owners
function returns an associative array in the form{ "userid_1": user_representation_1, "userid_2": user_representation_2 }
, so the check usingin_array
always returns false. Since the user IDs are the keys of the array, the function should instead usearray_key_exists
.The text was updated successfully, but these errors were encountered: