System:User:inGroup

From Aspen Documentation

Returns whether a user is in a group.

Since 1.0

Arguments

boolean inGroup (string $group_name, [integer $user_id = false])

group_name
Name of the group the user may belong to.
user_id
The user ID number.

Returns

Returns boolean, true if the user is in the group.

Examples

This example checks if the user with an id of 1 is in the Administrator group.

$this->APP->user->inGroup('Administrator', 1);