Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions apps/api/plane/app/permissions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ def decorator(view_func):
def _wrapped_view(instance, request, *args, **kwargs):
# Check for creator if required
if creator and model:
# check if the user is part of the workspace or not
Comment thread
NarayanBavisetti marked this conversation as resolved.
if not WorkspaceMember.objects.filter(
member=request.user,
workspace__slug=kwargs["slug"],
is_active=True,
).exists():
return Response(
{"error": "You don't have the required permissions."},
status=status.HTTP_403_FORBIDDEN,
)

obj = model.objects.filter(id=kwargs["pk"], created_by=request.user).exists()
Comment thread
NarayanBavisetti marked this conversation as resolved.
if obj:
Comment thread
NarayanBavisetti marked this conversation as resolved.
return view_func(instance, request, *args, **kwargs)
Expand Down
Loading