/** * @expectedException \Wasp\Security\SecurityException */ public function testShouldCreateAccessControlAndDenyAccess() { RoleManager::add('MANAGER'); Configuration::write(ConfigurationParameters::ACCESS_CONTROL_LIST_RULES, array('controller/action' => array('MANAGER' => Rule::DENY))); $accessControl = new AccessControl(); $accessControl->hasAuthority(new RoleImpl('MANAGER'), new ResourceImpl('controller/action')); }
public function start() { $resource = AccessControl::getResource($this->getRequestFactory()->get()->getResource()); $this->isAuthorized($resource); echo $this->getDispatcher()->dispatch($this->getRequestFactory()); }