You are here

class FilebrowserPermissions in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x src/FilebrowserPermissions.php \Drupal\filebrowser\FilebrowserPermissions

Hierarchy

Expanded class hierarchy of FilebrowserPermissions

File

src/FilebrowserPermissions.php, line 11

Namespace

Drupal\filebrowser
View source
class FilebrowserPermissions implements ContainerInjectionInterface {
  use StringTranslationTrait;

  /**
   * @var Common $common
   */
  protected $common;
  public function __construct(Common $common) {
    $this->common = $common;
  }
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('filebrowser.common'));
  }
  public function permissions() {
    return [
      Common::CREATE_LISTING => [
        'title' => $this
          ->t('Create a listing'),
        'description' => $this
          ->t('User is allowed to create a directory listing.'),
      ],
      Common::DELETE_OWN_LISTINGS => [
        'title' => $this
          ->t('Delete listings owned by user'),
        'description' => $this
          ->t('User is allowed to delete a listing created by themselves.'),
      ],
      Common::DELETE_ANY_LISTINGS => [
        'title' => $this
          ->t('Delete any listing'),
        'description' => $this
          ->t('User is allowed to delete any listing.'),
      ],
      Common::EDIT_OWN_LISTINGS => [
        'title' => $this
          ->t('Edit listings owned by user'),
        'description' => $this
          ->t('User can edit a listing owned by themselves.'),
      ],
      Common::EDIT_ANY_LISTINGS => [
        'title' => $this
          ->t('Edit any listing'),
        'description' => $this
          ->t('User can edit any listing.'),
      ],
      Common::VIEW_LISTINGS => [
        'title' => $this
          ->t('View listings'),
        'description' => $this
          ->t('User is allowed to view listings.'),
      ],
      Common::FILE_UPLOAD => [
        'title' => $this
          ->t('Upload files'),
        'description' => $this
          ->t('User is allowed to upload files. Node settings must be set to allow uploads.'),
      ],
      Common::DOWNLOAD_ARCHIVE => [
        'title' => $this
          ->t('Download zip archive'),
        'description' => $this
          ->t('Users are allowed to download files as an archive. Node settings must be set to allows downloading an archive.'),
        'restrict access' => false,
      ],
      Common::DELETE_FILES => [
        'title' => $this
          ->t('Delete files'),
        'description' => $this
          ->t('User is allowed to delete files.'),
      ],
      Common::RENAME_FILES => [
        'title' => $this
          ->t('Rename files'),
        'description' => $this
          ->t('User is allowed to rename file names. NOTE: renaming folders is not supported.'),
      ],
      Common::DOWNLOAD => [
        'title' => $this
          ->t('Download files'),
        'description' => $this
          ->t('User is allowed to download files'),
      ],
      Common::CREATE_FOLDER => [
        'title' => $this
          ->t('Create folder'),
        'description' => $this
          ->t('User is allowed to create new directories.'),
      ],
      Common::EDIT_DESCRIPTION => [
        'title' => $this
          ->t('Edit description'),
        'description' => $this
          ->t('User is allowed to edit file descriptions.'),
      ],
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FilebrowserPermissions::$common protected property
FilebrowserPermissions::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
FilebrowserPermissions::permissions public function
FilebrowserPermissions::__construct public function
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.