You are here

function forena_query_editor_access in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 forena_query.module \forena_query_editor_access()
  2. 7.4 forena_query.module \forena_query_editor_access()

Access function based on data b

Parameters

unknown $block_name:

string $action:

Return value

boolean

1 string reference to 'forena_query_editor_access'
forena_query_menu in forena_query/forena_query.module
Implementation of hook_menu

File

forena_query/forena_query.module, line 66
Provides the ability to create saved queries and to test sql data blocks.

Code

function forena_query_editor_access($block_name, $action = 'create') {
  $block_name = str_replace('.', '/', $block_name);
  @(list($provider, $block) = explode('/', $block_name));
  return \Drupal::currentUser()
    ->hasPermission("access {$provider} data") && \Drupal::currentUser()
    ->hasPermission("{$action} {$provider} blocks");
}