diff options
author | citrons <citrons> | 2021-06-25 05:33:00 +0000 |
---|---|---|
committer | citrons <citrons> | 2021-06-25 05:33:00 +0000 |
commit | 3a3e427695f3f6754297a2dde335358518d3373a (patch) | |
tree | 2fb6b2d400ee47727e370e5454047ac654305074 /apioforum/db.py | |
parent | 4bb33e0c18b45ae0cc0f87438c8e0432cf6250c1 (diff) |
permissions table
Diffstat (limited to 'apioforum/db.py')
-rw-r--r-- | apioforum/db.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/apioforum/db.py b/apioforum/db.py index 7dd635e..06682d6 100644 --- a/apioforum/db.py +++ b/apioforum/db.py @@ -117,7 +117,24 @@ CREATE VIEW most_recent_posts AS CREATE VIEW number_of_posts AS SELECT thread, count(*) AS num_replies FROM posts GROUP BY thread; """, - +""" +CREATE TABLE role_config ( + role TEXT NOT NULL, + forum NOT NULL REFERENCES forums(id), + id INTEGER PRIMARY KEY, + + 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_approve INT NOT NULL DEFAULT 0, + p_create_subforum INT NOT NULL DEFAULT 0 +); + +INSERT INTO role_config (role,forum) SELECT "approved",id FROM forums; +INSERT INTO role_config (role,forum) SELECT "other",id FROM forums; +""", ] def init_db(): |