function views_check_roles

cis7 views.module views_check_roles($rids, $account = NULL)
cle7 views.module views_check_roles($rids, $account = NULL)
elmsmedia7 views.module views_check_roles($rids, $account = NULL)
icor7 views.module views_check_roles($rids, $account = NULL)
meedjum_blog7 views.module views_check_roles($rids, $account = NULL)
mooc7 views.module views_check_roles($rids, $account = NULL)

Access callback for the views_plugin_access_role access plugin.

Determine if the specified user has access to a view on the basis of any of the requested roles. If the $account argument is omitted, the current user is used.

1 call to views_check_roles()
views_plugin_access_role::access in sites/all/modules/ulmus/views/plugins/views_plugin_access_role.inc
Determine if the current user has access or not.
1 string reference to 'views_check_roles'
views_plugin_access_role::get_access_callback in sites/all/modules/ulmus/views/plugins/views_plugin_access_role.inc
Determine the access callback and arguments.

File

sites/all/modules/ulmus/views/views.module, line 1001
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_check_roles($rids, $account = NULL) {
  global $user;
  $account = isset($account) ? $account : $user;
  $roles = array_keys($account->roles);
  $roles[] = $account->uid ? DRUPAL_AUTHENTICATED_RID : DRUPAL_ANONYMOUS_RID;
  return user_access('access all views', $account) || array_intersect(array_filter($rids), $roles);
}