Skip to content

Commit

Permalink
Plugin: Azure: adapt order for role verification to have first admin,…
Browse files Browse the repository at this point in the history
… then teacher to avoid setting a teacher role to an admin - refs BT#21500
  • Loading branch information
NicoDucou authored Sep 23, 2024
1 parent f5d563c commit df28327
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugin/azure_active_directory/src/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@

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

foreach ($azureGroups as $azureGroup) {
$azureGroupUid = $azureGroup['objectId'];

foreach ($roleGroups as $userRole => $groupUid) {
foreach ($roleGroups as $userRole => $groupUid) {
foreach ($azureGroups as $azureGroup) {
$azureGroupUid = $azureGroup['objectId'];
if ($azureGroupUid === $groupUid) {
$roleActions[$userRole]($user);

Expand Down

0 comments on commit df28327

Please sign in to comment.