[icinga-checkins] icinga.org: icinga-web/r1.8: Fix database nsm_target IcingaCommandRestrictions

git at icinga.org git at icinga.org
Thu Nov 29 17:39:09 CET 2012


Module: icinga-web
Branch: r1.8
Commit: d7d04f4418555b734360b1a5511d00ee19e72991
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=d7d04f4418555b734360b1a5511d00ee19e72991

Author: Markus Frosch <markus.frosch at netways.de>
Date:   Thu Nov 22 15:27:09 2012 +0100

Fix database nsm_target IcingaCommandRestrictions

for MySQL and PgSQL - Schema and Update for upcoming 1.8.1
(refs #3457)

---

 etc/schema/mysql.sql                               |    4 ++--
 etc/schema/pgsql.sql                               |    2 +-
 .../updates/mysql/mysql_v1-8-0_to_v-1-8-1.sql      |    5 +++++
 .../updates/pgsql/pgsql_v1-8-0_to_v-1-8-1.sql      |    5 +++++
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/etc/schema/mysql.sql b/etc/schema/mysql.sql
index 893c7f3..6ca0fba 100644
--- a/etc/schema/mysql.sql
+++ b/etc/schema/mysql.sql
@@ -61,7 +61,7 @@ INSERT INTO nsm_target (target_id,target_name,target_description,target_class,ta
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('16','icinga.cronk.log','Allow user to view icinga-log','','credential');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('17','icinga.control.view','Allow user to view icinga status','','credential');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('18','icinga.control.admin','Allow user to administrate the icinga process','','credential');
-INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('19','IcingaCommandRestrictions','Disable critical commands for this user','','icinga');
+INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('19','IcingaCommandRestrictions','Disable critical commands for this user','IcingaDataCommandRestrictionPrincipalTarget','icinga');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('20','icinga.cronk.custom','Allow user to create and modify custom cronks','','credential');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('21','icinga.cronk.admin','Allow user to edit and delete all cronks','','credential');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('22','IcingaService','Limit data access to specific services','IcingaDataServicePrincipalTarget','icinga');
@@ -90,4 +90,4 @@ INSERT INTO nsm_principal_target (pt_id,pt_principal_id,pt_target_id) VALUES ('1
 INSERT INTO nsm_principal_target (pt_id,pt_principal_id,pt_target_id) VALUES ('13','3','21');
 INSERT INTO nsm_user_role (usro_user_id,usro_role_id) VALUES ('1','1');
 INSERT INTO nsm_user_role (usro_user_id,usro_role_id) VALUES ('1','2');
-INSERT INTO nsm_user_role (usro_user_id,usro_role_id) VALUES ('1','3');
\ No newline at end of file
+INSERT INTO nsm_user_role (usro_user_id,usro_role_id) VALUES ('1','3');
diff --git a/etc/schema/pgsql.sql b/etc/schema/pgsql.sql
index 1cb22b0..42f4b51 100644
--- a/etc/schema/pgsql.sql
+++ b/etc/schema/pgsql.sql
@@ -742,7 +742,7 @@ COPY nsm_target (target_id, target_name, target_description, target_class, targe
 16	icinga.cronk.log	Allow user to view icinga-log		credential
 17	icinga.control.view	Allow user to view icinga status		credential
 18	icinga.control.admin	Allow user to administrate the icinga process		credential
-19	IcingaCommandRestrictions	Disable critical commands for this user	\N	icinga
+19	IcingaCommandRestrictions	Disable critical commands for this user	IcingaDataCommandRestrictionPrincipalTarget	icinga
 20	icinga.cronk.custom	Allow user to create and modify custom cronks	\N	credential
 21	icinga.cronk.admin	Allow user to edit and delete all cronks		credential
 22	IcingaService	Limit data access to specific services	IcingaDataServicePrincipalTarget	icinga
diff --git a/etc/schema/updates/mysql/mysql_v1-8-0_to_v-1-8-1.sql b/etc/schema/updates/mysql/mysql_v1-8-0_to_v-1-8-1.sql
new file mode 100644
index 0000000..8412a33
--- /dev/null
+++ b/etc/schema/updates/mysql/mysql_v1-8-0_to_v-1-8-1.sql
@@ -0,0 +1,5 @@
+DELETE FROM nsm_db_version;
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.1', NOW(), NOW());
+
+UPDATE nsm_target SET target_class = 'IcingaDataCommandRestrictionPrincipalTarget' WHERE target_name = 'IcingaCommandRestrictions';
+
diff --git a/etc/schema/updates/pgsql/pgsql_v1-8-0_to_v-1-8-1.sql b/etc/schema/updates/pgsql/pgsql_v1-8-0_to_v-1-8-1.sql
new file mode 100644
index 0000000..8412a33
--- /dev/null
+++ b/etc/schema/updates/pgsql/pgsql_v1-8-0_to_v-1-8-1.sql
@@ -0,0 +1,5 @@
+DELETE FROM nsm_db_version;
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.1', NOW(), NOW());
+
+UPDATE nsm_target SET target_class = 'IcingaDataCommandRestrictionPrincipalTarget' WHERE target_name = 'IcingaCommandRestrictions';
+





More information about the icinga-checkins mailing list