Merge branch 'ent-6176-10390-Problema-de-permisos-en-los-dashboard' into 'develop'

added acl checks on dashboard update

See merge request artica/pandorafms!3461
This commit is contained in:
Daniel Rodriguez 2020-09-17 16:33:15 +02:00
commit 02d364b66c
2 changed files with 44 additions and 19 deletions

View File

@ -219,7 +219,7 @@ class Manager
$this->stringGroups = \io_safe_output(
implode(
', ',
array_keys($this->groups)
array_values($this->groups)
)
);
@ -907,6 +907,11 @@ class Manager
{
global $config;
if (check_acl($config['id_user'], 0, 'RW') === 0) {
include 'general/noaccess.php';
return;
}
$name = \get_parameter('name', '');
$private = \get_parameter_switch('private');
$id_group = \get_parameter('id_group');

View File

@ -194,6 +194,14 @@ if ($config['public_dashboard'] === true) {
// 'slides' => $slides,
];
} else if ($config['pure']) {
if (check_acl($config['id_user'], 0, 'RW') === 0) {
$buttons = [
'back_to_dashboard_list' => $back_to_dashboard_list,
'normalscreen' => $normalscreen,
'combo_refresh_one_dashboard' => $comboRefresh,
'slides' => $slides,
];
} else {
$buttons = [
'back_to_dashboard_list' => $back_to_dashboard_list,
'save_layout' => $save_layout_dashboard,
@ -202,7 +210,18 @@ if ($config['public_dashboard'] === true) {
'slides' => $slides,
'options' => $options,
];
}
} else {
if (check_acl($config['id_user'], 0, 'RW') === 0) {
$buttons = [
'back_to_dashboard_list' => $back_to_dashboard_list,
'fullscreen' => $fullscreen,
'slides' => $slides,
'public_link' => $publiclink,
'combo_dashboard' => $combo_dashboard,
'newWidget' => $newWidget,
];
} else {
$buttons = [
'enable_disable' => $enable_disable,
'back_to_dashboard_list' => $back_to_dashboard_list,
@ -213,6 +232,7 @@ if ($config['public_dashboard'] === true) {
'options' => $options,
'newWidget' => $newWidget,
];
}
}
ui_print_page_header(