forked from github/plane
fix: workspace member role update (#1203)
This commit is contained in:
parent
799cf230b7
commit
bffc6a60e7
@ -445,7 +445,7 @@ class WorkSpaceMemberViewSet(BaseViewSet):
|
|||||||
requested_workspace_member = WorkspaceMember.objects.get(workspace__slug=slug, member=request.user)
|
requested_workspace_member = WorkspaceMember.objects.get(workspace__slug=slug, member=request.user)
|
||||||
# Check if role is being updated
|
# Check if role is being updated
|
||||||
# One cannot update role higher than his own role
|
# One cannot update role higher than his own role
|
||||||
if "role" in request.data and request.data.get("role", workspace_member.role) > requested_workspace_member.role:
|
if "role" in request.data and int(request.data.get("role", workspace_member.role)) > requested_workspace_member.role:
|
||||||
return Response(
|
return Response(
|
||||||
{
|
{
|
||||||
"error": "You cannot update a role that is higher than your own role"
|
"error": "You cannot update a role that is higher than your own role"
|
||||||
|
Loading…
Reference in New Issue
Block a user