Skip to content

Commit df28327

Browse files
authored
Plugin: Azure: adapt order for role verification to have first admin, then teacher to avoid setting a teacher role to an admin - refs BT#21500
1 parent f5d563c commit df28327

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugin/azure_active_directory/src/callback.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,9 @@
9797

9898
$azureGroups = $provider->get('me/memberOf', $token);
9999

100-
foreach ($azureGroups as $azureGroup) {
101-
$azureGroupUid = $azureGroup['objectId'];
102-
103-
foreach ($roleGroups as $userRole => $groupUid) {
100+
foreach ($roleGroups as $userRole => $groupUid) {
101+
foreach ($azureGroups as $azureGroup) {
102+
$azureGroupUid = $azureGroup['objectId'];
104103
if ($azureGroupUid === $groupUid) {
105104
$roleActions[$userRole]($user);
106105

0 commit comments

Comments
 (0)