Hi, Trying to check if a user is a member of a usergroup, and perform an action (deny access) if they are not, within PHP outside of XF templates. Here's the code .... PHP: $mouthUser = $userModel->getUserById($userId);$mouthAllow = array(3,4,17,29);$mouthErrorMessage = "Sorry, only specific usergroups are able to access";//if(!in_array($mouthUser['user_group_id'], $mouthAllow))if(!$mouthUser->isMemberOf($mouthAllow))return xmlresperror($mouthErrorMessage); You can see I commented out PHP: if(!in_array($mouthUser['user_group_id'], $mouthAllow)) because it only checked on the users primary usergroup, and not also any secondary usergroups. PHP: if(!$mouthUser->isMemberOf($mouthAllow)) throws an error and does not work. Would appreciate some assistance with what I should be doing here? Thanks.