The following code illustrates how to access groups an user is subscribed with Joomla ACL. Groups ids are returned in an array
1 2 3 4 5 6 7 |
$user = JFactory::getUser(); $userId = $user->id; jimport( 'joomla.access.access' ); $groups = JAccess::getGroupsByUser($userId); print_r($groups); |
To test the code, do not forget to lougout and login again should you have modified the user group from the back-end





