예제 #1
0
 /**
  * @param \Nette\Security\IResource $resource
  * @param bool $allowed
  */
 public function log(IResource $resource, $allowed)
 {
     if (count($this->allows) >= self::MAX_LINES) {
         return;
     }
     $this->allows[] = ['resource' => $resource->getResourceId(), 'allowed' => $allowed];
 }
예제 #2
0
 /**
  * @param IResource|string $resource
  * @return string
  */
 public static function stringifyResource($resource)
 {
     return $resource instanceof IResource ? $resource->getResourceId() : $resource;
 }