106
|
1 |
CREATE TABLE users ( |
|
2 |
id SERIAL PRIMARY KEY, |
|
3 |
username varchar(16) NOT NULL, |
|
4 |
password varchar(34) NOT NULL, |
|
5 |
fullname varchar(255) NOT NULL, |
|
6 |
email varchar(255) NOT NULL, |
|
7 |
description text NOT NULL, |
|
8 |
perm_templ integer default 0, |
|
9 |
active smallint default 0 |
|
10 |
); |
|
11 |
|
113
|
12 |
INSERT INTO users (username, password, fullname, email, description, perm_templ, active) VALUES ('admin','21232f297a57a5a743894a0e4a801fc3','Administrator','admin@example.net','Administrator with full rights.',1,1); |
106
|
13 |
|
|
14 |
CREATE TABLE perm_items ( |
|
15 |
id SERIAL PRIMARY KEY, |
|
16 |
name varchar(64) NOT NULL, |
|
17 |
descr text NOT NULL |
|
18 |
); |
|
19 |
|
118
|
20 |
INSERT INTO perm_items (name, descr) VALUES ('user_is_ueberuser','User has full access. God-like. Redeemer.'); |
|
21 |
INSERT INTO perm_items (name, descr) VALUES ('zone_master_add','User is allowed to add new master zones.'); |
|
22 |
INSERT INTO perm_items (name, descr) VALUES ('zone_slave_add','User is allowed to add new slave zones.'); |
|
23 |
INSERT INTO perm_items (name, descr) VALUES ('zone_content_view_own','User is allowed to see the content and meta data of zones he owns.'); |
|
24 |
INSERT INTO perm_items (name, descr) VALUES ('zone_content_edit_own','User is allowed to edit the content of zones he owns.'); |
|
25 |
INSERT INTO perm_items (name, descr) VALUES ('zone_meta_edit_own','User is allowed to edit the meta data of zones he owns.'); |
|
26 |
INSERT INTO perm_items (name, descr) VALUES ('zone_content_view_others','User is allowed to see the content and meta data of zones he does not own.'); |
|
27 |
INSERT INTO perm_items (name, descr) VALUES ('zone_content_edit_others','User is allowed to edit the content of zones he does not own.'); |
|
28 |
INSERT INTO perm_items (name, descr) VALUES ('zone_meta_edit_others','User is allowed to edit the meta data of zones he does not own.'); |
|
29 |
INSERT INTO perm_items (name, descr) VALUES ('search','User is allowed to perform searches.'); |
|
30 |
INSERT INTO perm_items (name, descr) VALUES ('supermaster_view','User is allowed to view supermasters.'); |
|
31 |
INSERT INTO perm_items (name, descr) VALUES ('supermaster_add','User is allowed to add new supermasters.'); |
|
32 |
INSERT INTO perm_items (name, descr) VALUES ('supermaster_edit','User is allowed to edit supermasters.'); |
|
33 |
INSERT INTO perm_items (name, descr) VALUES ('user_view_others','User is allowed to see other users and their details.'); |
|
34 |
INSERT INTO perm_items (name, descr) VALUES ('user_add_new','User is allowed to add new users.'); |
|
35 |
INSERT INTO perm_items (name, descr) VALUES ('user_edit_own','User is allowed to edit their own details.'); |
|
36 |
INSERT INTO perm_items (name, descr) VALUES ('user_edit_others','User is allowed to edit other users.'); |
|
37 |
INSERT INTO perm_items (name, descr) VALUES ('user_passwd_edit_others','User is allowed to edit the password of other users.'); |
|
38 |
INSERT INTO perm_items (name, descr) VALUES ('user_edit_templ_perm','User is allowed to change the permission template that is assigned to a user.'); |
|
39 |
INSERT INTO perm_items (name, descr) VALUES ('templ_perm_add','User is allowed to add new permission templates.'); |
|
40 |
INSERT INTO perm_items (name, descr) VALUES ('templ_perm_edit','User is allowed to edit existing permission templates.'); |
106
|
41 |
|
|
42 |
CREATE TABLE perm_templ ( |
|
43 |
id SERIAL PRIMARY KEY, |
|
44 |
name varchar(128) NOT NULL, |
|
45 |
descr text NOT NULL |
|
46 |
); |
|
47 |
|
113
|
48 |
INSERT INTO perm_templ (name, descr) VALUES ('Administrator','Administrator template with full rights.'); |
106
|
49 |
|
|
50 |
CREATE TABLE perm_templ_items ( |
|
51 |
id SERIAL PRIMARY KEY, |
|
52 |
templ_id integer NOT NULL, |
|
53 |
perm_id integer NOT NULL |
|
54 |
); |
|
55 |
|
113
|
56 |
INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (1,1); |
106
|
57 |
|
|
58 |
CREATE TABLE zones ( |
|
59 |
id SERIAL PRIMARY KEY, |
|
60 |
domain_id integer default 0, |
|
61 |
owner integer default 0, |
|
62 |
comment text |
|
63 |
); |
118
|
64 |
|
|
65 |
CREATE INDEX zone_domain_owner ON zones(domain_id, owner); |