Returns an array with all user groups.
Syntax
Security::getUserGroups()
Arguments
No arguments.
Return value
Returns an array with all user groups.
When Dynamic permissions are in effect, users may belong to more than one group. Security.getUserGroups() returns associative array where keys are user group names and values are true.
Example
This example shows how to print the groups if they include a group named accounts.
$groups = Security::getUserGroups();
if( $groups["accounts"] ) {
print_r($groups);
}
Sample output
Array
(
[accounts] => 1
[<Admin>] => 1
)
See also:
•Security: User group permissions