Introduce ModuleActionController::$requiresModulePermission

refs #9644
This commit is contained in:
Eric Lippmann 2015-07-22 14:56:02 +02:00
parent a75b1a35c6
commit aa567f8cd7

View File

@ -24,6 +24,17 @@ class ModuleActionController extends ActionController
*/
protected $moduleName;
/**
* Whether the module permission is required to access to module
*
* Note that module permissions do not have any effect if the controller does not require authentication.
*
* @var bool
*
* @see $requiresAuthentication For enabling/disabling whether the controller requires authentication.
*/
protected $requiresModulePermission = true;
/**
* (non-PHPDoc)
* @see \Icinga\Web\Controller\ActionController For the method documentation.
@ -43,6 +54,29 @@ class ModuleActionController extends ActionController
{
}
/**
* Get whether the module permission is required to access to module
*
* @return bool
*/
public function getRequiresModulePermission()
{
return $this->requiresModulePermission;
}
/**
* Set whether the module permission is required to access to module
*
* @param bool $required
*
* @return $this
*/
public function setRequiresModulePermission($required)
{
$this->requiresModulePermission = (bool) $required;
return $this;
}
public function Config($file = null)
{
if ($file === null) {