public function run()
{
// check implementation
if (!isset($this->map[$this->method])) {
throw new NotImplementedException();
}
$map = $this->map[$this->method];
// check permissions
if (isset($map['acl'])) {
if (!Acl::isAllowed($this->module, $map['acl'])) {
throw new ForbiddenException();
}
}
// dispatch controller
return Application::getInstance()->dispatch($map['module'], $map['controller'], ['crud' => $this->getCrud(), 'primary' => $this->getPrimaryKey(), 'data' => $this->data]);
}