You are here

protected static function FilebrowserAccessCheck::mapActionToPermission in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x src/Access/FilebrowserAccessCheck.php \Drupal\filebrowser\Access\FilebrowserAccessCheck::mapActionToPermission()
1 call to FilebrowserAccessCheck::mapActionToPermission()
FilebrowserAccessCheck::access in src/Access/FilebrowserAccessCheck.php
A custom access check.

File

src/Access/FilebrowserAccessCheck.php, line 33

Class

FilebrowserAccessCheck
Checks access to filebrowser page.

Namespace

Drupal\filebrowser\Access

Code

protected static function mapActionToPermission($action) {
  $permissions = [
    'delete' => Common::DELETE_FILES,
    'description' => Common::RENAME_FILES,
    'folder' => Common::CREATE_FOLDER,
    'upload' => Common::FILE_UPLOAD,
    'rename' => Common::RENAME_FILES,
    'archive' => Common::DOWNLOAD_ARCHIVE,
  ];
  return isset($permissions[$action]) ? $permissions[$action] : NULL;
}