Skip to content
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

Owner removal check incorrect when role is removed from user #2614

Open
darius-m opened this issue Jul 29, 2024 · 0 comments · May be fixed by #2646, #2647, #2648 or #2649
Open

Owner removal check incorrect when role is removed from user #2614

darius-m opened this issue Jul 29, 2024 · 0 comments · May be fixed by #2646, #2647, #2648 or #2649
Assignees
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

Comments

@darius-m
Copy link
Contributor

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 using in_array always returns false. Since the user IDs are the keys of the array, the function should instead use array_key_exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment