From: Eric Bollengier Date: Sat, 17 Nov 2007 09:58:50 +0000 (+0000) Subject: ebl Add roles X-Git-Tag: Release-3.0.0~2238 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5d0faeda478519ac3874c968fb8250506069d067;p=bacula%2Fbacula ebl Add roles git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5944 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/script/bweb-mysql.sql b/gui/bweb/script/bweb-mysql.sql index b8e964f3f5..915e3dff5f 100644 --- a/gui/bweb/script/bweb-mysql.sql +++ b/gui/bweb/script/bweb-mysql.sql @@ -19,16 +19,21 @@ CREATE TABLE bweb_role ); CREATE UNIQUE INDEX bweb_role_idx on bweb_role (rolename(255)); INSERT INTO bweb_role (rolename) VALUES ('r_user_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_group_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_configure'); + +INSERT INTO bweb_role (rolename) VALUES ('r_autochanger_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_location_mgnt'); INSERT INTO bweb_role (rolename) VALUES ('r_delete_job'); INSERT INTO bweb_role (rolename) VALUES ('r_prune'); INSERT INTO bweb_role (rolename) VALUES ('r_purge'); -INSERT INTO bweb_role (rolename) VALUES ('r_group_mgnt'); -INSERT INTO bweb_role (rolename) VALUES ('r_location_mgnt'); -INSERT INTO bweb_role (rolename) VALUES ('r_cancel_job'); + +INSERT INTO bweb_role (rolename) VALUES ('r_view_job'); +INSERT INTO bweb_role (rolename) VALUES ('r_view_stat'); + INSERT INTO bweb_role (rolename) VALUES ('r_run_job'); -INSERT INTO bweb_role (rolename) VALUES ('r_configure'); +INSERT INTO bweb_role (rolename) VALUES ('r_cancel_job'); INSERT INTO bweb_role (rolename) VALUES ('r_client_status'); -INSERT INTO bweb_role (rolename) VALUES ('r_view_job'); CREATE TABLE bweb_role_member ( diff --git a/gui/bweb/script/bweb-postgresql.sql b/gui/bweb/script/bweb-postgresql.sql index b77af35714..0e963a003b 100644 --- a/gui/bweb/script/bweb-postgresql.sql +++ b/gui/bweb/script/bweb-postgresql.sql @@ -45,16 +45,21 @@ CREATE TABLE bweb_role CREATE UNIQUE INDEX bweb_role_idx on bweb_role (rolename); INSERT INTO bweb_role (rolename) VALUES ('r_user_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_group_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_configure'); + +INSERT INTO bweb_role (rolename) VALUES ('r_autochanger_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_location_mgnt'); INSERT INTO bweb_role (rolename) VALUES ('r_delete_job'); INSERT INTO bweb_role (rolename) VALUES ('r_prune'); INSERT INTO bweb_role (rolename) VALUES ('r_purge'); -INSERT INTO bweb_role (rolename) VALUES ('r_group_mgnt'); -INSERT INTO bweb_role (rolename) VALUES ('r_location_mgnt'); -INSERT INTO bweb_role (rolename) VALUES ('r_cancel_job'); + +INSERT INTO bweb_role (rolename) VALUES ('r_view_job'); +INSERT INTO bweb_role (rolename) VALUES ('r_view_stat'); + INSERT INTO bweb_role (rolename) VALUES ('r_run_job'); -INSERT INTO bweb_role (rolename) VALUES ('r_configure'); +INSERT INTO bweb_role (rolename) VALUES ('r_cancel_job'); INSERT INTO bweb_role (rolename) VALUES ('r_client_status'); -INSERT INTO bweb_role (rolename) VALUES ('r_view_job'); CREATE TABLE bweb_role_member ( diff --git a/gui/bweb/script/upgrade-2.2_3.0_mysql.sql b/gui/bweb/script/upgrade-2.2_3.0_mysql.sql new file mode 100644 index 0000000000..58cec9149e --- /dev/null +++ b/gui/bweb/script/upgrade-2.2_3.0_mysql.sql @@ -0,0 +1,54 @@ +-- -------------------------------------------------- +-- Upgrade from 2.2 +-- -------------------------------------------------- + +CREATE TABLE bweb_user +( + userid serial not null, + username text not null, + use_acl boolean default false, + enabled boolean default true, + comment text default '', + passwd text default '', + primary key (userid) +); +CREATE UNIQUE INDEX bweb_user_idx on bweb_user (username(255)); + +CREATE TABLE bweb_role +( + roleid serial not null, + rolename text not null, +-- comment text default '', + primary key (roleid) +); +CREATE UNIQUE INDEX bweb_role_idx on bweb_role (rolename(255)); +INSERT INTO bweb_role (rolename) VALUES ('r_user_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_group_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_configure'); + +INSERT INTO bweb_role (rolename) VALUES ('r_autochanger_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_location_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_delete_job'); +INSERT INTO bweb_role (rolename) VALUES ('r_prune'); +INSERT INTO bweb_role (rolename) VALUES ('r_purge'); + +INSERT INTO bweb_role (rolename) VALUES ('r_view_job'); +INSERT INTO bweb_role (rolename) VALUES ('r_view_stat'); + +INSERT INTO bweb_role (rolename) VALUES ('r_run_job'); +INSERT INTO bweb_role (rolename) VALUES ('r_cancel_job'); +INSERT INTO bweb_role (rolename) VALUES ('r_client_status'); + +CREATE TABLE bweb_role_member +( + roleid integer not null, + userid integer not null, + primary key (roleid, userid) +); + +CREATE TABLE bweb_client_group_acl +( + client_group_id integer not null, + userid integer not null, + primary key (client_group_id, userid) +); diff --git a/gui/bweb/script/upgrade-2.2_3.0_postgresql.sql b/gui/bweb/script/upgrade-2.2_3.0_postgresql.sql index ed2a6b560e..6d3d3acfda 100644 --- a/gui/bweb/script/upgrade-2.2_3.0_postgresql.sql +++ b/gui/bweb/script/upgrade-2.2_3.0_postgresql.sql @@ -44,16 +44,21 @@ CREATE TABLE bweb_role CREATE UNIQUE INDEX bweb_role_idx on bweb_role (rolename); INSERT INTO bweb_role (rolename) VALUES ('r_user_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_group_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_configure'); + +INSERT INTO bweb_role (rolename) VALUES ('r_autochanger_mgnt'); +INSERT INTO bweb_role (rolename) VALUES ('r_location_mgnt'); INSERT INTO bweb_role (rolename) VALUES ('r_delete_job'); INSERT INTO bweb_role (rolename) VALUES ('r_prune'); INSERT INTO bweb_role (rolename) VALUES ('r_purge'); -INSERT INTO bweb_role (rolename) VALUES ('r_group_mgnt'); -INSERT INTO bweb_role (rolename) VALUES ('r_location_mgnt'); -INSERT INTO bweb_role (rolename) VALUES ('r_cancel_job'); + +INSERT INTO bweb_role (rolename) VALUES ('r_view_job'); +INSERT INTO bweb_role (rolename) VALUES ('r_view_stat'); + INSERT INTO bweb_role (rolename) VALUES ('r_run_job'); -INSERT INTO bweb_role (rolename) VALUES ('r_configure'); +INSERT INTO bweb_role (rolename) VALUES ('r_cancel_job'); INSERT INTO bweb_role (rolename) VALUES ('r_client_status'); -INSERT INTO bweb_role (rolename) VALUES ('r_view_job'); CREATE TABLE bweb_role_member (