* @param string $str
* The permission to check.
*
- * @param int $contactID
+ * @param int $userId
*
* @return bool
* true if yes, else false
*/
- public function check($str, $contactID = NULL) {
+ public function check($str, $userId = NULL) {
$str = $this->translatePermission($str, 'Drupal', array(
'view user account' => 'access user profiles',
'administer users' => 'administer users',
return TRUE;
}
if (function_exists('user_access')) {
- return user_access($str) ? TRUE : FALSE;
+ $account = NULL;
+ if ($userId) {
+ $account = user_load($userId);
+ }
+ return user_access($str, $account);
}
return TRUE;
}