public function Group::userHasPermission in Group 7
Check if a given user has a certain group permission.
Parameters
int $uid: The uid of the given user.
string $permission: The name of the group permission.
Return value
bool Whether the user has the specified permission.
File
- classes/
group.inc, line 430 - Defines the Entity API class for groups.
Class
- Group
- Main class for groups.
Code
public function userHasPermission($uid, $permission) {
return $uid == 1 || in_array($permission, $this
->userPermissions($uid));
}