public function simple_access_views_plugin_group::access in Simple Access 7.2
Same name and namespace in other branches
- 6.2 views/simple_access_views_plugin_group.inc \simple_access_views_plugin_group::access()
Determine if the current user has access or not.
Overrides views_plugin_access::access
File
- views/
simple_access_views_plugin_group.inc, line 11 - Views access plugin to make use of cimple access.
Class
- simple_access_views_plugin_group
- @file Views access plugin to make use of cimple access.
Code
public function access($account) {
$roles = array_keys($account->roles);
$roles[] = $account->uid ? DRUPAL_AUTHENTICATED_RID : DRUPAL_ANONYMOUS_RID;
$groups = simple_access_groups_from_roles($roles);
return array_intersect(array_filter($this->options['groups']), $groups);
}