From 0e277ad1ef4dae7b17bcc7d71f83f6c76494cf45 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 6 Apr 2015 13:49:28 +0200 Subject: [PATCH 1/4] Add new image for tree view, not view in internet explorer (cherry picked from commit b63f1cfe817448709561a5d06d99ad89d7e5b68e) --- pandora_console/images/pandora.png | Bin 0 -> 493 bytes .../include/javascript/tree/TreeController.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 pandora_console/images/pandora.png diff --git a/pandora_console/images/pandora.png b/pandora_console/images/pandora.png new file mode 100644 index 0000000000000000000000000000000000000000..bbe2ea5bc07cedee42c9b9cd1adb6e514b4b454c GIT binary patch literal 493 zcmVb zfEa-y`x!vsKM(*p{{aGs0Z24}7$DHG&*VQ70~FkNwTFR&m6rh^fDn41fCXeyyvbsQ zlaCgHRWaUwck=(jGqGS<1wk_gCJ;w}QcRU{3;+QHGNS<~S&wWENWq8iPr+=s zt>uoV8PY8_fY~5P5FchK*tmsf;uv0hz798K=7|7=0+=I^0n7@30K)JGIsp3%p8_Ui zm)E=AWboJSV9*eAK~*5ZtI3dWvyY*3zbV7Us}*4TK?>mtK;8p6^v9o1U_p>?K%s_W z#f#53a5@sM8)Pgj6ek{WLMQ-*IS7F4M+X1_hBYoo0WA0=K^`%ei$@6-kZX3{Y=cJ| zh5?`;i#J)sz`?=?R#*$nRLRSXtD!vr`GDFwv'); + .prepend(''); } // Normal group else { From f6405cb8e0f6ba96415bdef8e6442ebdd836dd4d Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 6 Apr 2015 15:50:35 +0200 Subject: [PATCH 2/4] Reduced the length of the profile types cause they only store 1 or 0 --- pandora_console/pandoradb.oracle.sql | 34 ++++++++++++++-------------- pandora_console/pandoradb.sql | 34 ++++++++++++++-------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index b8438d6a832..bdfc0f59a46 100755 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -823,23 +823,23 @@ CREATE TABLE torigen ( CREATE TABLE tperfil ( id_perfil NUMBER(10, 0) NOT NULL PRIMARY KEY, name CLOB default '', - incident_edit NUMBER(5, 0) default 0 NOT NULL, - incident_view NUMBER(5, 0) default 0 NOT NULL, - incident_management NUMBER(5, 0) default 0 NOT NULL, - agent_view NUMBER(5, 0) default 0 NOT NULL, - agent_edit NUMBER(5, 0) default 0 NOT NULL, - alert_edit NUMBER(5, 0) default 0 NOT NULL, - user_management NUMBER(5, 0) default 0 NOT NULL, - db_management NUMBER(5, 0) default 0 NOT NULL, - alert_management NUMBER(5, 0) default 0 NOT NULL, - pandora_management NUMBER(5, 0) default 0 NOT NULL, - report_view NUMBER(5, 0) default 0 NOT NULL, - report_edit NUMBER(5, 0) default 0 NOT NULL, - report_management NUMBER(5, 0) default 0 NOT NULL, - event_view NUMBER(5, 0) default 0 NOT NULL, - event_edit NUMBER(5, 0) default 0 NOT NULL, - event_management NUMBER(5, 0) default 0 NOT NULL, - agent_disable NUMBER(5, 0) default 0 NOT NULL + incident_edit NUMBER(1, 0) default 0 NOT NULL, + incident_view NUMBER(1, 0) default 0 NOT NULL, + incident_management NUMBER(1, 0) default 0 NOT NULL, + agent_view NUMBER(1, 0) default 0 NOT NULL, + agent_edit NUMBER(1, 0) default 0 NOT NULL, + alert_edit NUMBER(1, 0) default 0 NOT NULL, + user_management NUMBER(1, 0) default 0 NOT NULL, + db_management NUMBER(1, 0) default 0 NOT NULL, + alert_management NUMBER(1, 0) default 0 NOT NULL, + pandora_management NUMBER(1, 0) default 0 NOT NULL, + report_view NUMBER(1, 0) default 0 NOT NULL, + report_edit NUMBER(1, 0) default 0 NOT NULL, + report_management NUMBER(1, 0) default 0 NOT NULL, + event_view NUMBER(1, 0) default 0 NOT NULL, + event_edit NUMBER(1, 0) default 0 NOT NULL, + event_management NUMBER(1, 0) default 0 NOT NULL, + agent_disable NUMBER(1, 0) default 0 NOT NULL ); CREATE SEQUENCE tperfil_s INCREMENT BY 1 START WITH 1; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 5674dba4027..c38e69183e4 100755 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -782,23 +782,23 @@ CREATE TABLE IF NOT EXISTS `torigen` ( CREATE TABLE IF NOT EXISTS `tperfil` ( `id_perfil` int(10) unsigned NOT NULL auto_increment, `name` TEXT NOT NULL, - `incident_edit` tinyint(3) NOT NULL default '0', - `incident_view` tinyint(3) NOT NULL default '0', - `incident_management` tinyint(3) NOT NULL default '0', - `agent_view` tinyint(3) NOT NULL default '0', - `agent_edit` tinyint(3) NOT NULL default '0', - `alert_edit` tinyint(3) NOT NULL default '0', - `user_management` tinyint(3) NOT NULL default '0', - `db_management` tinyint(3) NOT NULL default '0', - `alert_management` tinyint(3) NOT NULL default '0', - `pandora_management` tinyint(3) NOT NULL default '0', - `report_view` tinyint(3) NOT NULL default '0', - `report_edit` tinyint(3) NOT NULL default '0', - `report_management` tinyint(3) NOT NULL default '0', - `event_view` tinyint(3) NOT NULL default '0', - `event_edit` tinyint(3) NOT NULL default '0', - `event_management` tinyint(3) NOT NULL default '0', - `agent_disable` tinyint(3) NOT NULL default '0', + `incident_edit` tinyint(1) NOT NULL DEFAULT 0, + `incident_view` tinyint(1) NOT NULL DEFAULT 0, + `incident_management` tinyint(1) NOT NULL DEFAULT 0, + `agent_view` tinyint(1) NOT NULL DEFAULT 0, + `agent_edit` tinyint(1) NOT NULL DEFAULT 0, + `alert_edit` tinyint(1) NOT NULL DEFAULT 0, + `user_management` tinyint(1) NOT NULL DEFAULT 0, + `db_management` tinyint(1) NOT NULL DEFAULT 0, + `alert_management` tinyint(1) NOT NULL DEFAULT 0, + `pandora_management` tinyint(1) NOT NULL DEFAULT 0, + `report_view` tinyint(1) NOT NULL DEFAULT 0, + `report_edit` tinyint(1) NOT NULL DEFAULT 0, + `report_management` tinyint(1) NOT NULL DEFAULT 0, + `event_view` tinyint(1) NOT NULL DEFAULT 0, + `event_edit` tinyint(1) NOT NULL DEFAULT 0, + `event_management` tinyint(1) NOT NULL DEFAULT 0, + `agent_disable` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id_perfil`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From a06f8eee09bb836c0f34701a19979e53fa319258 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 6 Apr 2015 15:51:53 +0200 Subject: [PATCH 3/4] Added new profile bits to control the access to the visual console and the network maps --- .../extras/pandoradb_migrate_5.1_to_6.0.mysql.sql | 14 ++++++++++++++ .../extras/pandoradb_migrate_5.1_to_6.0.oracle.sql | 14 ++++++++++++++ .../pandoradb_migrate_5.1_to_6.0.postgreSQL.sql | 14 ++++++++++++++ pandora_console/pandoradb.oracle.sql | 8 +++++++- pandora_console/pandoradb.postgreSQL.sql | 8 +++++++- pandora_console/pandoradb.sql | 6 ++++++ 6 files changed, 62 insertions(+), 2 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index 4ab94fad5a2..f51651480a2 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -70,3 +70,17 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('post_process_custom_values', ALTER TABLE `tnetwork_map` ADD COLUMN `id_tag` int(11) DEFAULT 0; ALTER TABLE `tnetwork_map` ADD COLUMN `store_group` int(11) DEFAULT 0; UPDATE `tnetwork_map` SET `store_group` = `id_group`; + +-- --------------------------------------------------------------------- +-- Table `tperfil` +-- --------------------------------------------------------------------- +ALTER TABLE `tperfil` ADD COLUMN `map_view` tinyint(1) NOT NULL DEFAULT 0; +ALTER TABLE `tperfil` ADD COLUMN `map_edit` tinyint(1) NOT NULL DEFAULT 0; +ALTER TABLE `tperfil` ADD COLUMN `map_management` tinyint(1) NOT NULL DEFAULT 0; +ALTER TABLE `tperfil` ADD COLUMN `vconsole_view` tinyint(1) NOT NULL DEFAULT 0; +ALTER TABLE `tperfil` ADD COLUMN `vconsole_edit` tinyint(1) NOT NULL DEFAULT 0; +ALTER TABLE `tperfil` ADD COLUMN `vconsole_management` tinyint(1) NOT NULL DEFAULT 0; + +UPDATE `tperfil` SET `map_view` = 1, `vconsole_view` = 1 WHERE `report_view` = 1; +UPDATE `tperfil` SET `map_edit` = 1, `vconsole_edit` = 1 WHERE `report_edit` = 1; +UPDATE `tperfil` SET `map_management` = 1, `vconsole_management` = 1 WHERE `report_management` = 1; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql index a1e52b9bff5..36ff8004e00 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql @@ -70,3 +70,17 @@ INSERT INTO tconfig (token, value) VALUES ('post_process_custom_values', '{"0.00 ALTER TABLE tnetwork_map ADD COLUMN id_tag NUMBER(11, 0) DEFAULT 0; ALTER TABLE tnetwork_map ADD COLUMN store_group NUMBER(11, 0) DEFAULT 0; UPDATE tnetwork_map SET store_group = id_group; + +-- --------------------------------------------------------------------- +-- Table `tperfil` +-- --------------------------------------------------------------------- +ALTER TABLE tperfil ADD COLUMN map_view NUMBER(1, 0) DEFAULT 0 NOT NULL; +ALTER TABLE tperfil ADD COLUMN map_edit NUMBER(1, 0) DEFAULT 0 NOT NULL; +ALTER TABLE tperfil ADD COLUMN map_management NUMBER(1, 0) DEFAULT 0 NOT NULL; +ALTER TABLE tperfil ADD COLUMN vconsole_view NUMBER(1, 0) DEFAULT 0 NOT NULL; +ALTER TABLE tperfil ADD COLUMN vconsole_edit NUMBER(1, 0) DEFAULT 0 NOT NULL; +ALTER TABLE tperfil ADD COLUMN vconsole_management NUMBER(1, 0) DEFAULT 0 NOT NULL; + +UPDATE tperfil SET map_view = 1, vconsole_view = 1 WHERE report_view = 1; +UPDATE tperfil SET map_edit = 1, vconsole_edit = 1 WHERE report_edit = 1; +UPDATE tperfil SET map_management = 1, vconsole_management = 1 WHERE report_management = 1; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql index 6882914fd26..3ca472b93c4 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql @@ -68,3 +68,17 @@ INSERT INTO "tconfig" ("token", "value") VALUES ('post_process_custom_values', ' ALTER TABLE "tnetwork_map" ADD COLUMN "id_tag" INTEGER DEFAULT 0; ALTER TABLE "tnetwork_map" ADD COLUMN "store_group" INTEGER DEFAULT 0; UPDATE "tnetwork_map" SET "store_group" = "id_group"; + +-- --------------------------------------------------------------------- +-- Table `tperfil` +-- --------------------------------------------------------------------- +ALTER TABLE "tperfil" ADD COLUMN "map_view" SMALLINT NOT NULL DEFAULT 0; +ALTER TABLE "tperfil" ADD COLUMN "map_edit" SMALLINT NOT NULL DEFAULT 0; +ALTER TABLE "tperfil" ADD COLUMN "map_management" SMALLINT NOT NULL DEFAULT 0; +ALTER TABLE "tperfil" ADD COLUMN "vconsole_view" SMALLINT NOT NULL DEFAULT 0; +ALTER TABLE "tperfil" ADD COLUMN "vconsole_edit" SMALLINT NOT NULL DEFAULT 0; +ALTER TABLE "tperfil" ADD COLUMN "vconsole_management" SMALLINT NOT NULL DEFAULT 0; + +UPDATE "tperfil" SET "map_view" = 1, "vconsole_view" = 1 WHERE "report_view" = 1; +UPDATE "tperfil" SET "map_edit" = 1, "vconsole_edit" = 1 WHERE "report_edit" = 1; +UPDATE "tperfil" SET "map_management" = 1, "vconsole_management" = 1 WHERE "report_management" = 1; diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index bdfc0f59a46..57a9a8f8710 100755 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -839,7 +839,13 @@ CREATE TABLE tperfil ( event_view NUMBER(1, 0) default 0 NOT NULL, event_edit NUMBER(1, 0) default 0 NOT NULL, event_management NUMBER(1, 0) default 0 NOT NULL, - agent_disable NUMBER(1, 0) default 0 NOT NULL + agent_disable NUMBER(1, 0) default 0 NOT NULL, + map_view NUMBER(1, 0) default 0 NOT NULL, + map_edit NUMBER(1, 0) default 0 NOT NULL, + map_management NUMBER(1, 0) default 0 NOT NULL, + vconsole_view NUMBER(1, 0) default 0 NOT NULL, + vconsole_edit NUMBER(1, 0) default 0 NOT NULL, + vconsole_management NUMBER(1, 0) default 0 NOT NULL ); CREATE SEQUENCE tperfil_s INCREMENT BY 1 START WITH 1; diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index a78404a135c..7d3ed285a8c 100755 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -738,7 +738,13 @@ CREATE TABLE "tperfil" ( "event_view" SMALLINT NOT NULL default 0, "event_edit" SMALLINT NOT NULL default 0, "event_management" SMALLINT NOT NULL default 0, - "agent_disable" SMALLINT NOT NULL default 0 + "agent_disable" SMALLINT NOT NULL default 0, + "map_view" SMALLINT NOT NULL default 0, + "map_edit" SMALLINT NOT NULL default 0, + "map_management" SMALLINT NOT NULL default 0, + "vconsole_view" SMALLINT NOT NULL default 0, + "vconsole_edit" SMALLINT NOT NULL default 0, + "vconsole_management" SMALLINT NOT NULL default 0 ); -- --------------------------------------------------------------------- diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index c38e69183e4..32fd2a49b0b 100755 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -799,6 +799,12 @@ CREATE TABLE IF NOT EXISTS `tperfil` ( `event_edit` tinyint(1) NOT NULL DEFAULT 0, `event_management` tinyint(1) NOT NULL DEFAULT 0, `agent_disable` tinyint(1) NOT NULL DEFAULT 0, + `map_view` tinyint(1) NOT NULL DEFAULT 0, + `map_edit` tinyint(1) NOT NULL DEFAULT 0, + `map_management` tinyint(1) NOT NULL DEFAULT 0, + `vconsole_view` tinyint(1) NOT NULL DEFAULT 0, + `vconsole_edit` tinyint(1) NOT NULL DEFAULT 0, + `vconsole_management` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id_perfil`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 533167e46ed32270d5ef077acc0057873a7493a0 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 6 Apr 2015 16:01:43 +0200 Subject: [PATCH 4/4] Added the values of the new access bits to the default profiles --- pandora_console/pandoradb.data.oracle.sql | 10 +++++----- pandora_console/pandoradb.data.postgreSQL.sql | 2 +- pandora_console/pandoradb_data.sql | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 26eb0c988ad..cc136482f9e 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -317,11 +317,11 @@ END;; -- BEGIN LOCK TABLE tperfil IN EXCLUSIVE MODE; -INSERT INTO tperfil VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0); -INSERT INTO tperfil VALUES (2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0); -INSERT INTO tperfil VALUES (3,'Chief Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1); -INSERT INTO tperfil VALUES (4,'Group coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1); -INSERT INTO tperfil VALUES (5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +INSERT INTO tperfil VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0); +INSERT INTO tperfil VALUES (2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0); +INSERT INTO tperfil VALUES (3,'Chief Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1); +INSERT INTO tperfil VALUES (4,'Group coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1); +INSERT INTO tperfil VALUES (5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); COMMIT; END;; diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 73c827d6a48..8abccd16c40 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -289,7 +289,7 @@ SELECT setval('tusuario_perfil_id_up_seq', (SELECT (SELECT MAX(id_up) FROM tusua -- -- Dumping data for table "tperfil" -- -INSERT INTO "tperfil" VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1),(4,'Group coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +INSERT INTO "tperfil" VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1),(4,'Group coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); SELECT setval('tperfil_id_perfil_seq', (SELECT (SELECT MAX(id_perfil) FROM tperfil))); -- diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index b64a5c642f0..a50d236132f 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -279,7 +279,7 @@ INSERT INTO `tusuario_perfil` (`id_up`, `id_usuario`, `id_perfil`, `id_grupo`, ` -- Dumping data for table `tperfil` -- -INSERT INTO `tperfil` VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1),(4,'Group coordinator',1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +INSERT INTO `tperfil` VALUES (1,'Operator (Read)',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0),(2,'Operator (Write)',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0),(3,'Chief Operator',1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1),(4,'Group coordinator',1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1),(5,'Pandora Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); -- -- Dumping data for table `tnews`