new kw for it services & sectors alignment & viewer access partial fixed
This commit is contained in:
@@ -9,7 +9,7 @@ from django.utils import timezone
|
||||
from drf_spectacular.utils import extend_schema, extend_schema_view
|
||||
|
||||
from igny8_core.api.base import SiteSectorModelViewSet
|
||||
from igny8_core.api.permissions import IsAuthenticatedAndActive, IsEditorOrAbove
|
||||
from igny8_core.api.permissions import IsAuthenticatedAndActive, IsEditorOrAbove, IsViewerOrAbove
|
||||
from igny8_core.api.response import success_response, error_response
|
||||
from igny8_core.api.throttles import DebugScopedRateThrottle
|
||||
from igny8_core.auth.models import Site
|
||||
@@ -39,7 +39,12 @@ class IntegrationViewSet(SiteSectorModelViewSet):
|
||||
permission_classes = [IsAuthenticatedAndActive, IsEditorOrAbove]
|
||||
throttle_scope = 'integration'
|
||||
throttle_classes = [DebugScopedRateThrottle]
|
||||
|
||||
|
||||
def get_permissions(self):
|
||||
if self.action in ['list', 'retrieve']:
|
||||
return [IsAuthenticatedAndActive(), IsViewerOrAbove()]
|
||||
return [IsAuthenticatedAndActive(), IsEditorOrAbove()]
|
||||
|
||||
def get_queryset(self):
|
||||
"""
|
||||
Override to filter integrations by site.
|
||||
@@ -998,6 +1003,11 @@ class PublishingSettingsViewSet(viewsets.ViewSet):
|
||||
permission_classes = [IsAuthenticatedAndActive, IsEditorOrAbove]
|
||||
throttle_scope = 'integration'
|
||||
throttle_classes = [DebugScopedRateThrottle]
|
||||
|
||||
def get_permissions(self):
|
||||
if self.action == 'retrieve':
|
||||
return [IsAuthenticatedAndActive(), IsViewerOrAbove()]
|
||||
return [IsAuthenticatedAndActive(), IsEditorOrAbove()]
|
||||
|
||||
def _get_site(self, site_id, request):
|
||||
"""Get site and verify user has access"""
|
||||
|
||||
Reference in New Issue
Block a user