diff options
author | citrons <citrons> | 2021-06-29 19:53:24 +0000 |
---|---|---|
committer | citrons <citrons> | 2021-06-29 19:53:24 +0000 |
commit | eb340b12ae9844d5ff2e4a927753c4d92d3f56e0 (patch) | |
tree | e9401f6fcdbee8c4bd69d93085b7a040a9058d1a /apioforum/db.py | |
parent | 3a3e427695f3f6754297a2dde335358518d3373a (diff) |
role config, UI, and things
Diffstat (limited to 'apioforum/db.py')
-rw-r--r-- | apioforum/db.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apioforum/db.py b/apioforum/db.py index 06682d6..b5cba39 100644 --- a/apioforum/db.py +++ b/apioforum/db.py @@ -123,11 +123,14 @@ CREATE TABLE role_config ( forum NOT NULL REFERENCES forums(id), id INTEGER PRIMARY KEY, + inherit INT NOT NULL DEFAULT 0, + p_create_threads INT NOT NULL DEFAULT 1, p_reply_threads INT NOT NULL DEFAULT 1, p_view_threads INT NOT NULL DEFAULT 1, - p_delete_threads INT NOT NULL DEFAULT 0, - p_lock_threads INT NOT NULL DEFAULT 0, + p_manage_threads INT NOT NULL DEFAULT 0, + p_vote INT NOT NULL DEFAULT 1, + p_create_polls INT NOT NULL DEFAULT 1, p_approve INT NOT NULL DEFAULT 0, p_create_subforum INT NOT NULL DEFAULT 0 ); @@ -135,6 +138,12 @@ CREATE TABLE role_config ( INSERT INTO role_config (role,forum) SELECT "approved",id FROM forums; INSERT INTO role_config (role,forum) SELECT "other",id FROM forums; """, +""" +CREATE TRIGGER default_role_config AFTER INSERT ON forums BEGIN + INSERT INTO role_config (role,forum) VALUES ("approved",new.id); + INSERT INTO role_config (role,forum) VALUES ("other",new.id); +END; +""" ] def init_db(): |