Get permission
@param string|Reflex\Lockdown\Permissions\PermissionInterface $key

@return Reflex\Lockdown\Permissions\PermissionInterface

@throws Reflex\Lockdown\PermissionNotFoundException
If Permission isn't found
979373
public function findPermissionByKey($key)
    {
        if ($key instanceof PermissionInterface) {
            return $key;
        }

        $result =   $this->permissionProvider->findByKey($key);
        if ($result) {
            return $result;
        }

        $exceptionMessage   =   "The permission '%(key)s' cannot be found.";

        throw new PermissionNotFound(isprintf($exceptionMessage, compact('key')));
    }
590420
protected function iblockGetById($id)
    {
        $res = CIBlock::getList([], [
            'ID' => (int) $id,
            'CHECK_PERMISSIONS' => 'N',
        ]);

        return $res->fetch() ?: null;
    }
480212
public function get($key)
    {
        if (!$this->has($key)) {
            throw new \Exception(sprintf('Identifier "%s" is not defined.', $key));
        }
        try {
            return $this->offsetGet($key);
        } catch (\Exception $exception) {
            throw $exception;
        }
    }
924205
public static function get($key)
    {
        exception_if(!array_has(self::$words, $key), LanguageKeyNotFoundException::class, $key);

        return array_get(self::$words, $key);
    }
1118586
protected function getValue($key)
    {
        $getResult = $this->getClient()->get($key);

        if ($this->getClient()->getResultCode() === \Memcached::RES_NOTFOUND) {
            throw new KeyNotFoundException();
        } elseif ($getResult === false) {
            throw new \Exception($this->getClient()->getResultMessage(), $this->getClient()->getResultCode());
        }

        return $getResult;
    }
588135
public function filterByPrimaryKey($key)
    {
        $this->addUsingAlias(RolePermissionTableMap::COL_ROLE_ID, $key[0], Criteria::EQUAL);
        $this->addUsingAlias(RolePermissionTableMap::COL_PERMISSION_ID, $key[1], Criteria::EQUAL);

        return $this;
    }
1002720
public function setPermission($key, $value)
    {
        if (empty($value)) {
            $value = self::GUEST;
        }

        if ($key == 'access') {
            $this->access = $value;
        } else {
            $permission = clone $this->permissions;
            $permission[$key] = $value;
            $this->set('permissions', $permission);
        }

        return $this;
    }
424459
public function getArrayAccessor($key)
    {
        $value = $this->get($key);
        if ($value === null or !is_array($value)) {
            return null;
        }
        return new ArrayAccessor($value);
    }
522259
public function get($key)
    {
        $filePath = $this->storageFolder . $key;
        if (file_exists($filePath)) {
            return file_get_contents($filePath);
        }

        return null;
    }
341976
public static function get($key) {
		$memcache = self::connect();
		$var = $memcache->get($key);
		if ($var === false) {
			throw new \Exception('Object not in cache');
		} else {
			return $var;
		}
	}
588547
public static function get($key)
    {
        $config = json_decode(file_get_contents(PATH . '/app/config.json'), true);

        if (! array_key_exists($key, $config)) {
            throw new ConfigItemNotSetException($key);
        }

        return $config[$key];
    }
1223878
public function getPermission($name)
    {
        if ($this->hasPermission($name)) {
            return $this->permissions[$name];
        }

        throw new \InvalidArgumentException(sprintf('No permission with name "%s" could be found', $name));
    }
824984
public function GetByPermission($Permission) {
      if (!is_array($Permission))
         $Permission = array($Permission);
         
      $this->SQL->Select('r.*')
         ->From('Role r')
         ->Join('Permission per', "per.RoleID = r.RoleID")
         ->Where('per.JunctionTable is null');
         
      $this->SQL->BeginWhereGroup();
      $PermissionCount = count($Permission);
      for ($i = 0; $i < $PermissionCount; ++$i) {
         $this->SQL->Where('per.`'.$Permission[$i].'`', 1);
      }
      $this->SQL->EndWhereGroup();
      return $this->SQL->Get();
   }
1131848
protected function getCachePermissions($cacheKey)
    {
        // Check local cache
        if (isset($this->cachePermissions[$cacheKey])) {
            return $this->cachePermissions[$cacheKey];
        }

        // Check persistent cache
        if ($this->cacheService) {
            $result = $this->cacheService->get($cacheKey);

            // Warm local cache
            if ($result) {
                $this->cachePermissions[$cacheKey] = $result;
                return $result;
            }
        }

        return null;
    }
772116
public function get(KeyInterface $key)
    {
        $value = $this->connection->get($key->getKeyName());

        return $value === false ? null : $value;
    }
822142
public function getCredential($key)
    {
        return !isset($this->credentials[$key]) ? null : $this->credentials[$key];
    }
824618
public function getPermission($name)
    {
        $permission = $this->parameters->get('permission');

        if (null === $permission) {
            throw new \LogicException('Current action does not require any authorization.');
        }

        if (true === $permission) {
            return sprintf('%s.%s.%s', $this->metadata->getApplicationName(), $this->metadata->getName(), $name);
        }

        return $permission;
    }