diff options
| author | citrons <citrons> | 2021-08-07 01:16:20 +0000 | 
|---|---|---|
| committer | citrons <citrons> | 2021-08-07 01:16:20 +0000 | 
| commit | 2cbb238d80533cf06b1b6a7e1353843a0f583dea (patch) | |
| tree | 0dd501c5a394d8fceb4046f0912a58274cdb695d | |
| parent | 7e5abdf79fb8358ed28d69241a929e3af4841d5b (diff) | |
admin users are automatically bureaucrats
| -rw-r--r-- | apioforum/forum.py | 1 | ||||
| -rw-r--r-- | apioforum/roles.py | 4 | 
2 files changed, 5 insertions, 0 deletions
diff --git a/apioforum/forum.py b/apioforum/forum.py index d177b16..bbc43fe 100644 --- a/apioforum/forum.py +++ b/apioforum/forum.py @@ -1,5 +1,6 @@  # view threads in a forum  # currently there is only ever one forum however +# ^ aha we never removed this. we should keep it. it is funny.  from flask import (      Blueprint, render_template, request, diff --git a/apioforum/roles.py b/apioforum/roles.py index 1e9b206..bd913a0 100644 --- a/apioforum/roles.py +++ b/apioforum/roles.py @@ -37,6 +37,10 @@ def get_role_config(forum_id, role):  def get_user_role(forum_id, user):      db = get_db() +    user = db.execute('SELECT * FROM users WHERE username = ?', +            (user,)).fetchone() +    if user == None: return "other" +    if user['admin']: return "bureaucrat"      fid = forum_id      the = None  | 
