chore: guest and viewer can leave project

This commit is contained in:
NarayanBavisetti 2023-12-12 16:22:33 +05:30
parent 1795916042
commit 90de11c08d

View File

@ -42,6 +42,7 @@ from plane.app.permissions import (
WorkspaceUserPermission,
ProjectBasePermission,
ProjectMemberPermission,
ProjectLitePermission,
)
from plane.db.models import (
@ -602,6 +603,18 @@ class ProjectMemberViewSet(BaseViewSet):
ProjectMemberPermission,
]
def get_permissions(self):
if self.action == "leave":
self.permission_classes = [
ProjectLitePermission,
]
else:
self.permission_classes = [
ProjectMemberPermission,
]
return super(ProjectMemberViewSet, self).get_permissions()
search_fields = [
"member__display_name",
"member__first_name",