You are here

function _relation_entity_collector_user_has_access in Relation 8

Same name and namespace in other branches
  1. 8.2 relation_entity_collector/relation_entity_collector.module \_relation_entity_collector_user_has_access()
  2. 7 relation_entity_collector/relation_entity_collector.module \_relation_entity_collector_user_has_access()

Access check helper.

3 calls to _relation_entity_collector_user_has_access()
relation_entity_collector_entity_view_alter in relation_entity_collector/relation_entity_collector.module
Implements hook_entity_view_alter().
relation_entity_collector_preprocess_username in relation_entity_collector/relation_entity_collector.module
Implements hook_preprocess_username().
relation_entity_collector_views_post_execute in relation_entity_collector/relation_entity_collector.module
Implements hook_views_post_execute().

File

relation_entity_collector/relation_entity_collector.module, line 26
Relation Entity Collector Block.

Code

function _relation_entity_collector_user_has_access() {
  $account = \Drupal::currentUser();
  return $account
    ->hasPermission('administer relations') || $account
    ->hasPermission('create relations');
}