chore: export issues permission changed (#5392)
This commit is contained in:
parent
854a90c3f1
commit
ffbc5942da
2 changed files with 5 additions and 3 deletions
|
|
@ -53,7 +53,7 @@ def allow_permission(allowed_roles, level="PROJECT", creator=False, model=None):
|
||||||
# Return permission denied if no conditions are met
|
# Return permission denied if no conditions are met
|
||||||
return Response(
|
return Response(
|
||||||
{"error": "You don't have the required permissions."},
|
{"error": "You don't have the required permissions."},
|
||||||
status=status.HTTP_401_UNAUTHORIZED,
|
status=status.HTTP_403_FORBIDDEN,
|
||||||
)
|
)
|
||||||
|
|
||||||
return _wrapped_view
|
return _wrapped_view
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class ExportIssuesEndpoint(BaseAPIView):
|
||||||
model = ExporterHistory
|
model = ExporterHistory
|
||||||
serializer_class = ExporterHistorySerializer
|
serializer_class = ExporterHistorySerializer
|
||||||
|
|
||||||
@allow_permission(allowed_roles=[ROLE.ADMIN], level="WORKSPACE")
|
@allow_permission(allowed_roles=[ROLE.ADMIN, ROLE.MEMBER], level="WORKSPACE")
|
||||||
def post(self, request, slug):
|
def post(self, request, slug):
|
||||||
# Get the workspace
|
# Get the workspace
|
||||||
workspace = Workspace.objects.get(slug=slug)
|
workspace = Workspace.objects.get(slug=slug)
|
||||||
|
|
@ -62,7 +62,9 @@ class ExportIssuesEndpoint(BaseAPIView):
|
||||||
status=status.HTTP_400_BAD_REQUEST,
|
status=status.HTTP_400_BAD_REQUEST,
|
||||||
)
|
)
|
||||||
|
|
||||||
@allow_permission(allowed_roles=[ROLE.ADMIN], level="WORKSPACE")
|
@allow_permission(
|
||||||
|
allowed_roles=[ROLE.ADMIN, ROLE.MEMBER], level="WORKSPACE"
|
||||||
|
)
|
||||||
def get(self, request, slug):
|
def get(self, request, slug):
|
||||||
exporter_history = ExporterHistory.objects.filter(
|
exporter_history = ExporterHistory.objects.filter(
|
||||||
workspace__slug=slug,
|
workspace__slug=slug,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue