chore: only admin can changed the project settings (#5766)
This commit is contained in:
parent
7495a7d0cb
commit
8a866e440c
1 changed files with 12 additions and 1 deletions
|
|
@ -413,9 +413,20 @@ class ProjectViewSet(BaseViewSet):
|
||||||
status=status.HTTP_410_GONE,
|
status=status.HTTP_410_GONE,
|
||||||
)
|
)
|
||||||
|
|
||||||
@allow_permission([ROLE.ADMIN])
|
|
||||||
def partial_update(self, request, slug, pk=None):
|
def partial_update(self, request, slug, pk=None):
|
||||||
try:
|
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)
|
workspace = Workspace.objects.get(slug=slug)
|
||||||
|
|
||||||
project = Project.objects.get(pk=pk)
|
project = Project.objects.get(pk=pk)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue