jumpserver/apps/ops/api/adhoc.py

23 lines
508 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2022-12-15 09:25:21 +00:00
from orgs.mixins.api import OrgBulkModelViewSet
2022-11-11 11:20:17 +00:00
from ..models import AdHoc
from ..serializers import (
2022-11-17 12:10:13 +00:00
AdHocSerializer
)
__all__ = [
2022-11-11 11:20:17 +00:00
'AdHocViewSet'
]
2022-12-15 09:25:21 +00:00
class AdHocViewSet(OrgBulkModelViewSet):
2022-11-17 12:10:13 +00:00
serializer_class = AdHocSerializer
permission_classes = ()
2022-12-06 09:30:54 +00:00
model = AdHoc
2022-12-15 09:25:21 +00:00
2022-12-21 09:14:07 +00:00
def allow_bulk_destroy(self, qs, filtered):
return True
2022-12-15 09:25:21 +00:00
def get_queryset(self):
queryset = super().get_queryset()
return queryset.filter(creator=self.request.user)