add User.is_elevated()

This one returns true if the user is either a Trusted User
or a Developer.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-08-28 16:14:07 -07:00
parent b59601a8b7
commit c006386079
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
2 changed files with 14 additions and 0 deletions

View file

@ -214,6 +214,11 @@ def test_user_credential_types():
assert aurweb.auth.developer(user)
assert aurweb.auth.trusted_user_or_dev(user)
# Some model authorization checks.
assert user.is_elevated()
assert user.is_trusted_user()
assert user.is_developer()
def test_user_json():
data = json.loads(user.json())