You are here

class elFinderDrupalACL in elFinder file manager 8.2

@file elfinder ACL class

Hierarchy

Expanded class hierarchy of elFinderDrupalACL

1 file declares its use of elFinderDrupalACL
elFinderConnectorController.php in src/Controller/elFinderConnectorController.php

File

src/Controller/elFinderDrupalACL.php, line 9
elfinder ACL class

Namespace

Drupal\elfinder\Controller
View source
class elFinderDrupalACL {
  public function fsAccessPublic($attr, $path, $data, $volume) {
    $tmbdir = \Drupal::config('elfinder.settings')
      ->get('thumbnail.dirname');
    $rootpath = drupal_realpath('public://');
    if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
      return TRUE;
    }

    /* Hiding thumbnail folder */
    if (!empty($tmbdir) && strstr($path, DIRECTORY_SEPARATOR . $tmbdir) && $attr == 'hidden') {
      return TRUE;
    }
    if (($path == "{$rootpath}/.quarantine" || $path == "{$rootpath}/js" || $path == "{$rootpath}/css" || $path == "{$rootpath}/php") && $attr == 'hidden') {
      return TRUE;
    }
    if (strstr($path, "{$rootpath}/config_") && $attr == 'hidden') {
      return TRUE;
    }
    if ($attr == 'read') {
      return TRUE;
    }
    if ($attr == 'write') {
      return TRUE;
    }
    return FALSE;
  }
  public function fsAccessPrivate($attr, $path, $data, $volume) {
    $tmbdir = \Drupal::config('elfinder.settings')
      ->get('thumbnail.dirname');
    if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
      return TRUE;
    }

    /* Hiding thumbnail folder */
    if (!empty($tmbdir) && strstr($path, DIRECTORY_SEPARATOR . $tmbdir) && $attr == 'hidden') {
      return TRUE;
    }
    if (strstr($path, DIRECTORY_SEPARATOR . '.quarantine') && $attr == 'hidden') {
      return TRUE;
    }
    if ($attr == 'read') {
      return TRUE;
    }
    if ($attr == 'write') {
      return TRUE;
    }
    return FALSE;
  }
  public function fsAccessUnmanaged($attr, $path, $data, $volume) {
    $tmbdir = \Drupal::config('elfinder.settings')
      ->get('thumbnail.dirname');
    if (strpos(basename($path), '.') === 0 && $attr == 'hidden') {
      return TRUE;
    }

    /* Hiding thumbnail folder */
    if (!empty($tmbdir) && strstr($path, DIRECTORY_SEPARATOR . $tmbdir) && $attr == 'hidden') {
      return TRUE;
    }
    if (strstr($path, DIRECTORY_SEPARATOR . '.quarantine') && $attr == 'hidden') {
      return TRUE;
    }
    if ($attr == 'read') {
      return TRUE;
    }
    return FALSE;
  }

}

Members