USER Methods

groups()

Gets list of groups the current user is assigned to or checks if user is part of a certain group.

mixed groups([ int check ])

Return

List of groups or TRUE if user is part of a group

Parameter
Description
checkCheck if user is part of this group

Get groups of current user

$USER->groups()
RETURN: ARRAY [1]

Check if user is part of group

$USER->groups(5)
RETURN: TRUE