Merge branch 'ent-4728-Desactivar-Restart-Map-para-usuarios-sin-permisos' into 'develop'
Ent 4728 desactivar restart map para usuarios sin permisos See merge request artica/pandorafms!2805
This commit is contained in:
commit
a1b879d065
|
@ -2642,8 +2642,17 @@ class NetworkMap
|
|||
*/
|
||||
public function loadMapData()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$networkmap = $this->map;
|
||||
|
||||
// ACL.
|
||||
$networkmap_write = check_acl(
|
||||
$config['id_user'],
|
||||
$networkmap['id_group'],
|
||||
'MW'
|
||||
);
|
||||
|
||||
$simulate = false;
|
||||
if (isset($networkmap['__simulated']) === false) {
|
||||
$networkmap['filter'] = json_decode(
|
||||
|
@ -2711,6 +2720,7 @@ class NetworkMap
|
|||
$output .= 'var networkmap_center = [ '.$networkmap['center_x'].', '.$networkmap['center_y']."];\n";
|
||||
$output .= 'var networkmap_dimensions = [ '.$networkmap['width'].', '.$networkmap['height']."];\n";
|
||||
$output .= 'var enterprise_installed = '.((int) enterprise_installed()).";\n";
|
||||
$output .= 'var networkmap_write = '.$networkmap_write.";\n";
|
||||
$output .= 'var node_radius = '.$networkmap['filter']['node_radius'].";\n";
|
||||
$output .= 'var networkmap_holding_area_dimensions = '.json_encode($networkmap['filter']['holding_area']).";\n";
|
||||
$output .= "var networkmap = {'nodes': [], 'links': []};\n";
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
/* global holding_area_dimensions */
|
||||
/* global networkmap_id */
|
||||
/* global enterprise_installed */
|
||||
/* global networkmap_write */
|
||||
/* global force */
|
||||
/* global layer_graph_nodes */
|
||||
/* global layer_graph_links */
|
||||
|
@ -2087,10 +2088,15 @@ function show_menu(item, data) {
|
|||
icon: "add_node",
|
||||
disabled: function() {
|
||||
if (enterprise_installed) {
|
||||
// Check if user can write network maps.
|
||||
if (networkmap_write) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
callback: function(key, options) {
|
||||
add_node();
|
||||
|
@ -2099,6 +2105,14 @@ function show_menu(item, data) {
|
|||
items_list["center"] = {
|
||||
name: set_center_menu,
|
||||
icon: "center",
|
||||
disabled: function() {
|
||||
// Check if user can write network maps.
|
||||
if (networkmap_write) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
callback: function(key, options) {
|
||||
set_center(networkmap_id);
|
||||
}
|
||||
|
@ -2136,10 +2150,15 @@ function show_menu(item, data) {
|
|||
icon: "restart_map",
|
||||
disabled: function() {
|
||||
if (enterprise_installed) {
|
||||
// Check if user can write network maps.
|
||||
if (networkmap_write) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
callback: function(key, options) {
|
||||
restart_map();
|
||||
|
|
Loading…
Reference in New Issue