mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
608 B
25 lines
608 B
# -*- coding: utf-8 -*- |
|
from orgs.mixins.api import OrgBulkModelViewSet |
|
from rbac.permissions import RBACPermission |
|
from ..models import AdHoc |
|
from ..serializers import ( |
|
AdHocSerializer |
|
) |
|
|
|
__all__ = [ |
|
'AdHocViewSet' |
|
] |
|
|
|
|
|
class AdHocViewSet(OrgBulkModelViewSet): |
|
serializer_class = AdHocSerializer |
|
permission_classes = (RBACPermission,) |
|
search_fields = ('name', 'comment') |
|
model = AdHoc |
|
|
|
def allow_bulk_destroy(self, qs, filtered): |
|
return True |
|
|
|
def get_queryset(self): |
|
queryset = super().get_queryset() |
|
return queryset.filter(creator=self.request.user)
|
|
|