Example #1
0
 /**
  * @param \Phpro\SmartCrud\Event\CrudEvent                 $event
  * @param \BjyAuthorize\Service\Authorize                  $authorizeService
  * @param \Zend\Permissions\Acl\Resource\ResourceInterface $resource
  */
 protected function mockEvent($authorizeService, $event, $resource)
 {
     $authorizeService->isAllowed(Argument::cetera())->willReturn(true);
     $this->mockListenerFactory($authorizeService->getWrappedObject());
     $event->getEntity()->willReturn($resource->getWrappedObject());
 }
Example #2
0
 /**
  * @param CrudEvent $e
  *
  * @return bool
  */
 public function isDeleteAllowed(CrudEvent $e)
 {
     return $this->isAllowed($e->getEntity(), self::PRIVILEGE_DELETE);
 }