make play key perms make sense

adjust GM level 1 name and some related displays
This commit is contained in:
aronwk-aaron 2022-11-28 18:48:28 -06:00
parent 4aff169967
commit 19f38b379e
4 changed files with 10 additions and 10 deletions

View File

@ -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 = {}

View File

@ -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/<count>/<uses>', 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/<id>', 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/<id>', 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/<id>', 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),

View File

@ -46,7 +46,7 @@
<a id='property-index' class='nav-link' href='{{ url_for('properties.index') }}'>Properties</a>
{% 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 #}
<a id='play_keys-index' class='nav-link' href='{{ url_for('play_keys.index') }}'>Play Keys</a>
{% endif %}

View File

@ -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 %}