Skip to content

Commit

Permalink
fix: removing permissions from user notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramveeraghanta committed Aug 22, 2024
1 parent 9f20936 commit 460003c
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions apiserver/plane/app/views/notification/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ def partial_update(self, request, slug, pk):
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

@allow_permission(
allowed_roles=[ROLE.ADMIN, ROLE.MEMBER, ROLE.VIEWER, ROLE.GUEST], level="WORKSPACE"
allowed_roles=[ROLE.ADMIN, ROLE.MEMBER, ROLE.VIEWER, ROLE.GUEST],
level="WORKSPACE",
)
def mark_read(self, request, slug, pk):
notification = Notification.objects.get(
Expand Down Expand Up @@ -244,7 +245,6 @@ def unarchive(self, request, slug, pk):


class UnreadNotificationEndpoint(BaseAPIView):

@allow_permission(
allowed_roles=[ROLE.ADMIN, ROLE.MEMBER, ROLE.VIEWER, ROLE.GUEST],
level="WORKSPACE",
Expand Down Expand Up @@ -286,7 +286,6 @@ def get(self, request, slug):


class MarkAllReadNotificationViewSet(BaseViewSet):

@allow_permission(
allowed_roles=[ROLE.ADMIN, ROLE.MEMBER], level="WORKSPACE"
)
Expand Down Expand Up @@ -373,9 +372,6 @@ class UserNotificationPreferenceEndpoint(BaseAPIView):
serializer_class = UserNotificationPreferenceSerializer

# request the object
@allow_permission(
allowed_roles=[ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST], level="WORKSPACE"
)
def get(self, request):
user_notification_preference = UserNotificationPreference.objects.get(
user=request.user
Expand All @@ -386,9 +382,6 @@ def get(self, request):
return Response(serializer.data, status=status.HTTP_200_OK)

# update the object
@allow_permission(
allowed_roles=[ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST], level="WORKSPACE"
)
def patch(self, request):
user_notification_preference = UserNotificationPreference.objects.get(
user=request.user
Expand Down

0 comments on commit 460003c

Please sign in to comment.