/** * Check current user entry in group by code. * * @param string $code Group's code. * * @return bool */ public function inGroup($code) { $groupId = GroupTools::find($code, true)->id(); if ((int) $groupId > 0) { global $USER; return in_array($groupId, $USER->GetUserGroupArray()); } return false; }