You are here

function forena_query_permission in Forena Reports 7.3

Same name and namespace in other branches
  1. 8 forena_query/forena_query.module \forena_query_permission()
  2. 7.5 forena_query.module \forena_query_permission()
  3. 7.4 forena_query.module \forena_query_permission()

Implementation of hook_permission

File

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

Code

function forena_query_permission() {
  $perms = array(
    'build forena sql blocks' => array(
      'title' => 'Build Forena Data Blocks using SQL',
      'description' => 'Direct access to SQL should not be given without understanding of security ramifications',
    ),
    'forena data security' => array(
      'title' => 'Manage forena data security',
      'description' => 'Allows to create new data queries and alter security on saved queries.',
    ),
  );
  foreach (Frx::RepoMan()->repositories as $repos => $conf) {
    $name = $conf['title'] ? $conf['title'] : $repos;
    $perms['create ' . $repos . ' blocks'] = array(
      'title' => 'Create ' . $name . ' Data Blocks',
    );
  }
  return $perms;
}