Add imports support for UserGroup
This commit is contained in:
parent
61812d6115
commit
f1c3f9025b
|
@ -42,5 +42,10 @@ class IcingaUserGroupForm extends DirectorObjectForm
|
||||||
'label' => $this->translate('Cluster Zone'),
|
'label' => $this->translate('Cluster Zone'),
|
||||||
'description' => $this->translate('Check this usergroup in this specific Icinga cluster zone')
|
'description' => $this->translate('Check this usergroup in this specific Icinga cluster zone')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addElement('text', 'imports', array(
|
||||||
|
'label' => $this->translate('Imports'),
|
||||||
|
'description' => $this->translate('The inherited usergroup template names')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ class IcingaUserGroup extends IcingaObject
|
||||||
{
|
{
|
||||||
protected $table = 'icinga_usergroup';
|
protected $table = 'icinga_usergroup';
|
||||||
|
|
||||||
|
protected $supportsImports = true;
|
||||||
|
|
||||||
protected $defaultProperties = array(
|
protected $defaultProperties = array(
|
||||||
'id' => null,
|
'id' => null,
|
||||||
'object_name' => null,
|
'object_name' => null,
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
CREATE TABLE icinga_usergroup_inheritance (
|
||||||
|
usergroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_usergroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (usergroup_id, parent_usergroup_id),
|
||||||
|
UNIQUE KEY unique_order (usergroup_id, weight),
|
||||||
|
CONSTRAINT icinga_usergroup_inheritance_usergroup
|
||||||
|
FOREIGN KEY usergroup (usergroup_id)
|
||||||
|
REFERENCES icinga_usergroup (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_usergroup_inheritance_parent_usergroup
|
||||||
|
FOREIGN KEY usergroup (parent_usergroup_id)
|
||||||
|
REFERENCES icinga_usergroup (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
@ -695,6 +695,24 @@ CREATE TABLE icinga_usergroup (
|
||||||
KEY search_idx (display_name)
|
KEY search_idx (display_name)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE icinga_usergroup_inheritance (
|
||||||
|
usergroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_usergroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (usergroup_id, parent_usergroup_id),
|
||||||
|
UNIQUE KEY unique_order (usergroup_id, weight),
|
||||||
|
CONSTRAINT icinga_usergroup_inheritance_usergroup
|
||||||
|
FOREIGN KEY usergroup (usergroup_id)
|
||||||
|
REFERENCES icinga_usergroup (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_usergroup_inheritance_parent_usergroup
|
||||||
|
FOREIGN KEY usergroup (parent_usergroup_id)
|
||||||
|
REFERENCES icinga_usergroup (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE icinga_usergroup_user (
|
CREATE TABLE icinga_usergroup_user (
|
||||||
usergroup_id INT(10) UNSIGNED NOT NULL,
|
usergroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
user_id INT(10) UNSIGNED NOT NULL,
|
user_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
CREATE TABLE icinga_usergroup_inheritance (
|
||||||
|
usergroup_id integer NOT NULL,
|
||||||
|
parent_usergroup_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (usergroup_id, parent_usergroup_id),
|
||||||
|
CONSTRAINT icinga_usergroup_inheritance_usergroup
|
||||||
|
FOREIGN KEY (usergroup_id)
|
||||||
|
REFERENCES icinga_usergroup (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_usergroup_inheritance_parent_usergroup
|
||||||
|
FOREIGN KEY (parent_usergroup_id)
|
||||||
|
REFERENCES icinga_usergroup (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX usergroup_inheritance_unique_order ON icinga_usergroup_inheritance (usergroup_id, weight);
|
||||||
|
CREATE INDEX usergroup_inheritance_usergroup ON icinga_usergroup_inheritance (usergroup_id);
|
||||||
|
CREATE INDEX usergroup_inheritance_usergroup_parent ON icinga_usergroup_inheritance (parent_usergroup_id);
|
|
@ -832,6 +832,28 @@ CREATE UNIQUE INDEX usergroup_search_idx ON icinga_usergroup (display_name);
|
||||||
CREATE INDEX usergroup_object_name ON icinga_usergroup (object_name, zone_id);
|
CREATE INDEX usergroup_object_name ON icinga_usergroup (object_name, zone_id);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE icinga_usergroup_inheritance (
|
||||||
|
usergroup_id integer NOT NULL,
|
||||||
|
parent_usergroup_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (usergroup_id, parent_usergroup_id),
|
||||||
|
CONSTRAINT icinga_usergroup_inheritance_usergroup
|
||||||
|
FOREIGN KEY (usergroup_id)
|
||||||
|
REFERENCES icinga_usergroup (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_usergroup_inheritance_parent_usergroup
|
||||||
|
FOREIGN KEY (parent_usergroup_id)
|
||||||
|
REFERENCES icinga_usergroup (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX usergroup_inheritance_unique_order ON icinga_usergroup_inheritance (usergroup_id, weight);
|
||||||
|
CREATE INDEX usergroup_inheritance_usergroup ON icinga_usergroup_inheritance (usergroup_id);
|
||||||
|
CREATE INDEX usergroup_inheritance_usergroup_parent ON icinga_usergroup_inheritance (parent_usergroup_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE icinga_usergroup_user (
|
CREATE TABLE icinga_usergroup_user (
|
||||||
usergroup_id integer NOT NULL,
|
usergroup_id integer NOT NULL,
|
||||||
user_id integer NOT NULL,
|
user_id integer NOT NULL,
|
||||||
|
|
Loading…
Reference in New Issue