Skip to content

Commit

Permalink
fix(access): fallback to django permissions if org permissions check …
Browse files Browse the repository at this point in the history
…is false

!35 #109 fixes #101
  • Loading branch information
jon-nfc committed Jul 11, 2024
1 parent f5ae01b commit 29c4b4a
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions app/access/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,24 @@ def permission_check(self, request, permissions_required: list = None) -> bool:

is_organization_manager = True

if not self.has_organization_permission() and not request.user.is_superuser and not is_organization_manager:
return False
return True


if request.user.is_superuser:

return True

perms = self.get_permission_required()

if self.has_organization_permission():

return True

if self.request.user.has_perms(perms):

return True

return True
return False



Expand Down

0 comments on commit 29c4b4a

Please sign in to comment.