fix(fastapi): only elevated users are allowed to suspend accounts

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-08 18:18:41 -08:00
parent 446a082352
commit 85ebc72e8a
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
5 changed files with 72 additions and 9 deletions

View file

@ -42,14 +42,16 @@
"account is inactive." | tr }}</em>
</p>
<p>
<label for="id_inactive">{% trans %}Inactive{% endtrans %}:</label>
<input id="id_inactive" type="checkbox" name="J"
{% if inactive %}
checked="checked"
{% endif %}
>
</p>
{% if request.user.is_elevated() %}
<p>
<label for="id_inactive">{% trans %}Inactive{% endtrans %}:</label>
<input id="id_inactive" type="checkbox" name="J"
{% if inactive %}
checked="checked"
{% endif %}
>
</p>
{% endif %}
{% if request.user.has_credential("CRED_ACCOUNT_CHANGE_TYPE") %}
<p>