diff --git a/mobile_tools.module b/mobile_tools.module index 50a94eb..0caad06 100755 --- a/mobile_tools.module +++ b/mobile_tools.module @@ -866,7 +866,10 @@ function mobile_tools_views_check_access($device, $perms, $rids){ return FALSE; } // Additional check - if (!empty($perms)) { + if ($perms !== TRUE && !empty($perms)) { + if (!is_array($perms)) { + $perms = array($perms); + } foreach ($perms as $perm) { $access = $access && user_access($perm); } @@ -876,6 +879,9 @@ function mobile_tools_views_check_access($device, $perms, $rids){ $roles = array_keys($account->roles); $roles[] = $account->uid ? DRUPAL_AUTHENTICATED_RID : DRUPAL_ANONYMOUS_RID; if($rids){ + if (!is_array($rids)) { + $rids = array($rids); + } $access = $access && (user_access('access all views', $account) || array_intersect(array_filter($rids), $roles)); } return $access;