1 -- --------------------------------------------------
3 -- --------------------------------------------------
5 CREATE FUNCTION concat (text, text) RETURNS text AS '
17 CREATE AGGREGATE group_concat(
26 ALTER TABLE client_group ADD COLUMN comment text;
28 CREATE TABLE bweb_user
30 userid serial not null,
31 username text not null,
32 use_acl boolean default false,
33 enabled boolean default true,
34 comment text default '',
35 passwd text default '',
38 CREATE UNIQUE INDEX bweb_user_idx on bweb_user (username);
40 CREATE TABLE bweb_role
42 roleid serial not null,
43 rolename text not null,
44 comment text default '',
47 CREATE UNIQUE INDEX bweb_role_idx on bweb_role (rolename);
49 INSERT INTO bweb_role (rolename) VALUES ('r_user_mgnt');
50 INSERT INTO bweb_role (rolename) VALUES ('r_group_mgnt');
51 INSERT INTO bweb_role (rolename) VALUES ('r_configure');
53 INSERT INTO bweb_role (rolename) VALUES ('r_autochanger_mgnt');
54 INSERT INTO bweb_role (rolename) VALUES ('r_location_mgnt');
55 INSERT INTO bweb_role (rolename) VALUES ('r_delete_job');
56 INSERT INTO bweb_role (rolename) VALUES ('r_prune');
57 INSERT INTO bweb_role (rolename) VALUES ('r_purge');
59 INSERT INTO bweb_role (rolename) VALUES ('r_view_job');
60 INSERT INTO bweb_role (rolename) VALUES ('r_view_stat');
61 INSERT INTO bweb_role (rolename) VALUES ('r_view_media');
63 INSERT INTO bweb_role (rolename) VALUES ('r_run_job');
64 INSERT INTO bweb_role (rolename) VALUES ('r_cancel_job');
65 INSERT INTO bweb_role (rolename) VALUES ('r_client_status');
67 CREATE TABLE bweb_role_member
69 roleid integer not null,
70 userid integer not null,
71 primary key (roleid, userid)
74 CREATE TABLE bweb_client_group_acl
76 client_group_id integer not null,
77 userid integer not null,
78 primary key (client_group_id, userid)