chore: only admin can changed the project settings (#5766)

This commit is contained in:
Bavisetti Narayan
2024-10-07 20:07:24 +05:30
committed by sriram veeraghanta
parent 7495a7d0cb
commit 8a866e440c

View File

@@ -413,9 +413,20 @@ class ProjectViewSet(BaseViewSet):
status=status.HTTP_410_GONE,
)
@allow_permission([ROLE.ADMIN])
def partial_update(self, request, slug, pk=None):
try:
if not ProjectMember.objects.filter(
member=request.user,
workspace__slug=slug,
project_id=pk,
role=20,
is_active=True,
).exists():
return Response(
{"error": "You don't have the required permissions."},
status=status.HTTP_403_FORBIDDEN,
)
workspace = Workspace.objects.get(slug=slug)
project = Project.objects.get(pk=pk)