1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

Simple test to check permissions with the new OAuth2 implementation

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
2021-06-17 22:29:57 +02:00
parent a3fd8ba063
commit fbf64db16e
2 changed files with 95 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class PermissionBackend(ModelBackend):
user = request.user
def permission_filter(membership_obj):
return Q(mask__rank__lte=request.session.get("permission_mask", -1))
return Q(mask__rank__lte=request.session.get("permission_mask", 42))
if user.is_anonymous:
# Unauthenticated users have no permissions