Skip to content
Snippets Groups Projects
Commit 387fbabc authored by Liam Morland's avatar Liam Morland
Browse files

ISTWCMS-4907: Create uw_cfg_common_get_user_ad_groups()

parent e71ecb64
No related branches found
No related tags found
1 merge request!161ISTWCMS-4907: Implement access control for Webforms
......@@ -632,3 +632,14 @@ function uw_cfg_common_array_split_clean(?string $data): array {
$data = array_unique($data);
return $data;
}
/**
* Return the Active Directory groups that the current user is part of.
*
* @return null|string[]
* An array of Active Directory group names or NULL if unable to determine.
*/
function uw_cfg_common_get_user_ad_groups(): ?array {
$attributes = \Drupal::service('simplesamlphp_auth.manager')->getAttributes();
return $attributes['http://schemas.xmlsoap.org/claims/Group'] ?? NULL;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment