8,7 → 8,7 |
-- see/use an user if he is the 'boss' or is the same user |
-- modify password - as above |
-- modify login - only if he is the 'boss', not of his own, and only inside some name rules (e.g. name@domain) |
-- 'superuser' is allowed to do anything with all objects, but cannot delete himself or modify own |
-- 'superuser' is allowed to do anything with all objects, but cannot delete himself or modify own |
-- 'superuser' flag (to guarantee at least one superuser exists in the system) |
create table users |
( |
16,7 → 16,9 |
login varchar(255) not null, |
password varchar(255) not null, |
boss integer, |
superuser char(1) default 'N' check (superuser = 'Y' or superuser = 'N'), |
superuser char(1) default ' ' check (superuser = '1' or superuser = ' '), |
enabled char(1) default '1' check (enabled = '1' or enabled = ' '), |
comment text, |
mod_stamp timestamp, |
mod_user integer, |
|
26,7 → 28,7 |
); |
|
-- default user admin:admin |
insert into users (id, login, password, superuser) values (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'Y'); |
insert into users (id, login, password, superuser) values (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', '1'); |
select nextval('hibernate_sequence'); -- skip id of the default user |
|
-- an user is allowed to see and use a system user if he is the 'owner' or the system user has no owner (null) |
36,6 → 38,8 |
uid integer not null, |
name varchar(255) not null, |
owner integer, |
enabled char(1) default '1' check (enabled = '1' or enabled = ' '), |
comment text, |
mod_stamp timestamp, |
mod_user integer, |
|
50,6 → 54,8 |
id integer not null, |
name varchar(255) not null, |
owner integer not null, |
enabled char(1) default '1' check (enabled = '1' or enabled = ' '), |
comment text, |
mod_stamp timestamp, |
mod_user integer, |
|
67,9 → 73,11 |
password varchar(255), -- if null, then owner's password is used |
domain integer not null, |
owner integer not null, |
virusCheck char(1), |
spamCheck char(1), |
virusCheck char(1) default '1' check (virusCheck = '1' or virusCheck = ' '), |
spamCheck char(1) default '1' check (spamCheck = '1' or spamCheck = ' '), |
systemuser integer, |
enabled char(1) default '1' check (enabled = '1' or enabled = ' '), |
comment text, |
mod_stamp timestamp, |
mod_user integer, |
|
87,6 → 95,8 |
address varchar(255) not null, |
domain integer not null, |
owner integer not null, |
enabled char(1) default '1' check (enabled = '1' or enabled = ' '), |
comment text, |
mod_stamp timestamp, |
mod_user integer, |
|
102,6 → 112,8 |
alias integer not null, |
mailbox integer, |
email varchar(255), |
enabled char(1) default '1' check (enabled = '1' or enabled = ' '), |
comment text, |
mod_stamp timestamp, |
mod_user integer, |
|