1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-11-08 15:59:50 +01:00

Add test for oauth2 flow, add temporary ROPB for NoteApp #137

This commit is contained in:
quark
2025-11-07 10:31:59 +01:00
parent d2cc1b902d
commit 68341a2a7e
4 changed files with 160 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ class PermissionBackend(ModelBackend):
@staticmethod
@memoize
def get_raw_permissions(request, t):
def get_raw_permissions(request, t): # noqa: C901
"""
Query permissions of a certain type for a user, then memoize it.
:param request: The current request
@@ -42,7 +42,7 @@ class PermissionBackend(ModelBackend):
if 'mask' in request.GET:
try:
rank = int(request.GET['mask'])
except:
except ValueError:
rank = 42
query &= Q(mask__rank__lte=rank)
for scope in request.auth.scope.split(' '):