equal
deleted
inserted
replaced
33 if is_authenticated and session_ext_id: |
33 if is_authenticated and session_ext_id: |
34 return Session.objects.filter(ext_id=session_ext_id, owner=request.user).exists() |
34 return Session.objects.filter(ext_id=session_ext_id, owner=request.user).exists() |
35 else: |
35 else: |
36 return True |
36 return True |
37 |
37 |
|
38 class RootNotePermission(IsAuthenticated): |
|
39 """ |
|
40 Permissions for notes |
|
41 """ |
|
42 |
|
43 def has_permission(self, request, view): |
|
44 """ |
|
45 Return `True` if permission is granted, `False` otherwise. |
|
46 """ |
|
47 is_authenticated = super().has_permission(request, view) |
|
48 return is_authenticated |
|
49 # if not is_authenticated: |
|
50 # return False |
|
51 # session_ext_id = view.kwargs.get('session_ext_id') |
|
52 # if is_authenticated and session_ext_id: |
|
53 # return Session.objects.filter(ext_id=session_ext_id, owner=request.user).exists() |
|
54 # else: |
|
55 # return True |