quota stat by organization - v1
This commit is contained in:
@@ -6,6 +6,7 @@ from apps.authentication.services.visibility_services import apply_visibility_fi
|
||||
from apps.authorization.services.role_child import get_all_role_child
|
||||
from apps.core.models import MobileTest, SystemConfig
|
||||
from apps.core.serializers import MobileTestSerializer, SystemConfigSerializer
|
||||
from apps.core.services.visibility_service import apply_visibility_filter_by_org_type
|
||||
|
||||
|
||||
class BaseViewSet(RegionFilterMixin, viewsets.ModelViewSet):
|
||||
@@ -29,6 +30,11 @@ class BaseViewSet(RegionFilterMixin, viewsets.ModelViewSet):
|
||||
queryset = apply_visibility_filter(queryset, org)
|
||||
return queryset
|
||||
|
||||
if visibility_by_org_scope:
|
||||
""" if organization has free visibility by org type, apply visibility filter """
|
||||
queryset = apply_visibility_filter_by_org_type(queryset, org)
|
||||
return queryset
|
||||
|
||||
if user_relation.exists():
|
||||
user_relation = user_relation.first()
|
||||
if not user_relation.role.type.key == 'ADM':
|
||||
|
||||
Reference in New Issue
Block a user