From acf7f59eef97d611f9162fcbfc2937c89efc44b4 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Tue, 17 Jan 2023 03:33:36 +0530 Subject: [PATCH] fix: fix nomenclature update on permission filter attributes (#179) --- apiserver/plane/api/permissions/project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apiserver/plane/api/permissions/project.py b/apiserver/plane/api/permissions/project.py index f87aaf08e..eea5192d5 100644 --- a/apiserver/plane/api/permissions/project.py +++ b/apiserver/plane/api/permissions/project.py @@ -49,7 +49,7 @@ class ProjectMemberPermission(BasePermission): ## Safe Methods -> Handle the filtering logic in queryset if request.method in SAFE_METHODS: return ProjectMember.objects.filter( - workspace=view.workspace, member=request.user + workspace__slug=view.workspace_slug, member=request.user ).exists() ## Only workspace owners or admins can create the projects if request.method == "POST": @@ -77,7 +77,7 @@ class ProjectEntityPermission(BasePermission): ## Safe Methods -> Handle the filtering logic in queryset if request.method in SAFE_METHODS: return ProjectMember.objects.filter( - workspace=view.workspace, + workspace__slug=view.workspace_slug, member=request.user, project_id=view.project_id, ).exists()