You are here

public function FrxDataSource::access in Forena Reports 7.5

Implements the basic default security check of calling an access method.

Parameters

unknown_type $arg:

Return value

unknown

File

src/Driver/FrxDataSource.php, line 43
Class that defines default methods for access control in an FrxDataSource

Class

FrxDataSource

Namespace

Drupal\forena\Driver

Code

public function access($arg) {
  $obj_access = TRUE;
  $access = user_access('access ' . $this->name . ' data');
  $f = @$this->conf['access callback'];
  if ($arg) {
    if ($f && is_callable($f)) {
      $obj_access = $f($arg);
    }
    elseif (isset($this->conf['access block'])) {
      $block = @$this->conf['access block'];
      $path = '';
      if (isset($this->conf['access path'])) {
        $path = $this->conf['access path'];
      }
      $obj_access = Frx::DataManager()
        ->blockAccess($block, $path, $arg);
    }
  }
  return $access && $obj_access;
}