You are here

public static function Imce::accessFilePaths in IMCE 8

Same name and namespace in other branches
  1. 8.2 src/Imce.php \Drupal\imce\Imce::accessFilePaths()

Checks if the selected file paths are accessible by a user with Imce.

Returns the accessible paths.

2 calls to Imce::accessFilePaths()
Imce::accessFileUri in src/Imce.php
Checks if a file uri is accessible by a user with Imce.
ImceFileField::setWidgetValue in src/ImceFileField.php
Sets widget file id values by validating and processing the submitted data.

File

src/Imce.php, line 331

Class

Imce
Imce container class for helper methods.

Namespace

Drupal\imce

Code

public static function accessFilePaths(array $paths, AccountProxyInterface $user = NULL, $scheme = NULL) {
  $ret = [];
  if ($fm = static::userFM($user, $scheme)) {
    foreach ($paths as $path) {
      if ($fm
        ->checkFile($path)) {
        $ret[] = $path;
      }
    }
  }
  return $ret;
}