1 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.

File

core/modules/views/views.module, line 889
Primarily Backdrop hooks and global API functions to manipulate views.

Code

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