Imbo\Resource::getReadOnlyResources PHP Method

getReadOnlyResources() final public static method

Returns a list of resources which should be accessible for read-only public keys
final public static getReadOnlyResources ( ) : array
return array
    public static final function getReadOnlyResources()
    {
        return [self::USER_GET, self::USER_HEAD, self::USER_OPTIONS, self::IMAGE_GET, self::IMAGE_HEAD, self::IMAGE_OPTIONS, self::IMAGES_GET, self::IMAGES_HEAD, self::IMAGES_OPTIONS, self::METADATA_GET, self::METADATA_HEAD, self::METADATA_OPTIONS, self::SHORTURL_GET, self::SHORTURL_HEAD, self::SHORTURL_OPTIONS, self::GLOBAL_IMAGES_GET, self::GLOBAL_IMAGES_HEAD, self::GLOBAL_IMAGES_OPTIONS, self::SHORTURLS_OPTIONS];
    }

Usage Example

示例#1
0
 /**
  * Ask user which resources the public key should have access to
  *
  * @param  InputInterface  $input
  * @param  OutputInterface $output
  * @return array
  */
 private function askForResources(InputInterface $input, OutputInterface $output)
 {
     $question = new ChoiceQuestion('Which resources should the public key have access to? ', [self::RESOURCES_READ_ONLY, self::RESOURCES_READ_WRITE, self::RESOURCES_ALL, self::RESOURCES_SPECIFIC, self::RESOURCES_CUSTOM], self::RESOURCES_SPECIFIC);
     $type = $this->getHelper('question')->ask($input, $output, $question);
     switch ($type) {
         case self::RESOURCES_READ_ONLY:
             return Resource::getReadOnlyResources();
         case self::RESOURCES_READ_WRITE:
             return Resource::getReadWriteResources();
         case self::RESOURCES_ALL:
             return Resource::getAllResources();
         case self::RESOURCES_CUSTOM:
             return $this->askForCustomResources($input, $output);
     }
     return $this->askForSpecificResources($input, $output);
 }
All Usage Examples Of Imbo\Resource::getReadOnlyResources