From 19f38b379ee57848e889e989ff987626ae21ef95 Mon Sep 17 00:00:00 2001 From: aronwk-aaron Date: Mon, 28 Nov 2022 18:48:28 -0600 Subject: [PATCH] make play key perms make sense adjust GM level 1 name and some related displays --- app/main.py | 2 +- app/play_keys.py | 14 +++++++------- app/templates/header.html.j2 | 2 +- app/templates/partials/_gm_level.html.j2 | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/main.py b/app/main.py index 6ac54a6..862ee45 100644 --- a/app/main.py +++ b/app/main.py @@ -31,7 +31,7 @@ def index(): @login_required def about(): """About Page""" - mods = Account.query.filter(Account.gm_level > 0).order_by(Account.gm_level.desc()).all() + mods = Account.query.filter(Account.gm_level > 1).order_by(Account.gm_level.desc()).all() online = 0 users = [] zones = {} diff --git a/app/play_keys.py b/app/play_keys.py index 7109f6d..9765800 100644 --- a/app/play_keys.py +++ b/app/play_keys.py @@ -11,14 +11,14 @@ play_keys_blueprint = Blueprint('play_keys', __name__) # Key creation page @play_keys_blueprint.route('/', methods=['GET']) @login_required -@gm_level(9) +@gm_level(5) def index(): return render_template('play_keys/index.html.j2') @play_keys_blueprint.route('/create//', methods=['GET'], defaults={'count': 1, 'uses': 1}) @login_required -@gm_level(9) +@gm_level(5) def create(count=1, uses=1): key = PlayKey.create(count=count, uses=uses) log_audit(f"Created {count} Play Key(s) with {uses} uses!") @@ -28,7 +28,7 @@ def create(count=1, uses=1): @play_keys_blueprint.route('/create/bulk', methods=('GET', 'POST')) @login_required -@gm_level(9) +@gm_level(5) def bulk_create(): form = CreatePlayKeyForm() if form.validate_on_submit(): @@ -42,7 +42,7 @@ def bulk_create(): @play_keys_blueprint.route('/delete/', methods=('GET', 'POST')) @login_required -@gm_level(9) +@gm_level(5) def delete(id): key = PlayKey.query.filter(PlayKey.id == id).first() # associated_accounts = Account.query.filter(Account.play_key_id==id).all() @@ -54,7 +54,7 @@ def delete(id): @play_keys_blueprint.route('/edit/', methods=('GET', 'POST')) @login_required -@gm_level(9) +@gm_level(5) def edit(id): key = PlayKey.query.filter(PlayKey.id == id).first() form = EditPlayKeyForm() @@ -81,7 +81,7 @@ def edit(id): @play_keys_blueprint.route('/view/', methods=('GET', 'POST')) @login_required -@gm_level(9) +@gm_level(5) def view(id): key = PlayKey.query.filter(PlayKey.id == id).first() accounts = Account.query.filter(Account.play_key_id == id).all() @@ -90,7 +90,7 @@ def view(id): @play_keys_blueprint.route('/get', methods=['GET']) @login_required -@gm_level(9) +@gm_level(5) def get(): columns = [ ColumnDT(PlayKey.id), diff --git a/app/templates/header.html.j2 b/app/templates/header.html.j2 index 227957c..cf26bff 100644 --- a/app/templates/header.html.j2 +++ b/app/templates/header.html.j2 @@ -46,7 +46,7 @@ Properties {% endif %} - {% if current_user.is_authenticated and current_user.gm_level == 9 and config.REQUIRE_PLAY_KEY %} + {% if current_user.is_authenticated and current_user.gm_level >= 5 and config.REQUIRE_PLAY_KEY %} {# Play Keys #} Play Keys {% endif %} diff --git a/app/templates/partials/_gm_level.html.j2 b/app/templates/partials/_gm_level.html.j2 index 6efff22..b94d9b4 100644 --- a/app/templates/partials/_gm_level.html.j2 +++ b/app/templates/partials/_gm_level.html.j2 @@ -14,7 +14,7 @@ {% if gm_level==0 %} Player {% elif gm_level==1 %} - Key Distributor + Elevevated Civilan {# Unused #} {% elif gm_level==2 %} Junior Moderator {% elif gm_level==3 %}