Skip to content

Commit

Permalink
chore: only admin can changed the project settings (#5766)
Browse files Browse the repository at this point in the history
  • Loading branch information
NarayanBavisetti authored Oct 7, 2024
1 parent c92fe61 commit 39eabc2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion apiserver/plane/app/views/project/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,20 @@ def create(self, request, slug):
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)
Expand Down

0 comments on commit 39eabc2

Please sign in to comment.