public function setAction($action, $module = null)
{
// set module
if ($module !== null) {
$this->setModule($module);
}
// check if module is set
if ($this->getModule() === null) {
throw new Exception('Module has not yet been set.');
}
// is this action allowed?
if (!Authentication::isAllowedAction($action, $this->getModule())) {
// set correct headers
header('HTTP/1.1 403 Forbidden');
// throw exception
throw new Exception('Action not allowed.');
}
// set property
$this->action = (string) \SpoonFilter::toCamelCase($action);
}