protected function setupResource(Resource $resource) { if ($resource->getName() === $resource->getNameRaw() && !$this->hasResource($resource->getName())) { $this->addResource($resource->getName()); } $this->allow($resource->getRole()->getName(), $resource->getName(), $resource->getAction()); }
/** * @param Trejjam\Authorization\Acl\Resource $resource */ public function addResource(Resource $resource) { $this->resources[$resource->getId()] = $resource; }
public function registerResource(Resource $resource) { $this->resource[$resource->getId()] = $resource; $resource->connectToRole($this->roles); }