Added management_allowed

This commit is contained in:
fbsanchez 2018-07-24 17:55:33 +02:00
parent ba676e13e3
commit 581cf7c5a0
1 changed files with 13 additions and 0 deletions

View File

@ -1363,6 +1363,19 @@ function is_metaconsole() {
return (bool) $config['metaconsole'];
}
/**
* @brief Check if there is management operations are allowed in current context
* (node // meta)
*
* @return bool
*/
function is_management_allowed() {
global $config;
return ( (is_metaconsole() && $config["centralized_management"])
|| (is_metaconsole() && !$config["centralized_management"])
|| (!is_metaconsole() && !$config["centralized_management"]));
}
/**
* @brief Check if there is centralized management in metaconsole environment.
* Usefull to display some policy features on metaconsole.