From 8ab142c122229b3c264dc22934807c241a51e22a Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Tue, 24 Mar 2020 20:25:08 +0100 Subject: [PATCH] no need to be static after all --- apps/permission/backends.py | 1 - apps/permission/permissions.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/permission/backends.py b/apps/permission/backends.py index 62b0c09f..e61b0719 100644 --- a/apps/permission/backends.py +++ b/apps/permission/backends.py @@ -89,7 +89,6 @@ class PermissionBackend(ModelBackend): query = query | perm.query return query - @staticmethod def has_perm(self, user_obj, perm, obj=None): if user_obj is None or isinstance(user_obj, AnonymousUser): return False diff --git a/apps/permission/permissions.py b/apps/permission/permissions.py index 9fb36f35..7959065f 100644 --- a/apps/permission/permissions.py +++ b/apps/permission/permissions.py @@ -42,7 +42,7 @@ class StrongDjangoObjectPermissions(DjangoObjectPermissions): perms = self.get_required_object_permissions(request.method, model_cls) # if not user.has_perms(perms, obj): - if not all(PermissionBackend.has_perm(user, perm, obj) for perm in perms): + if not all(PermissionBackend().has_perm(user, perm, obj) for perm in perms): # If the user does not have permissions we need to determine if # they have read permissions to see 403, or not, and simply see # a 404 response.