mirror of https://github.com/jumpserver/jumpserver
revert: 还原api限制
parent
e2406955bc
commit
8a2eb70ad2
|
@ -43,17 +43,7 @@ class OrgQuerySetMixin:
|
||||||
|
|
||||||
|
|
||||||
class OrgViewSetMixin(OrgQuerySetMixin):
|
class OrgViewSetMixin(OrgQuerySetMixin):
|
||||||
root_org_readonly_msg = _("Root organization only allow view and delete")
|
pass
|
||||||
|
|
||||||
def update(self, request, *args, **kwargs):
|
|
||||||
if current_org.is_root():
|
|
||||||
raise MethodNotAllowed('put', self.root_org_readonly_msg)
|
|
||||||
return super().update(request, *args, **kwargs)
|
|
||||||
|
|
||||||
def create(self, request, *args, **kwargs):
|
|
||||||
if current_org.is_root():
|
|
||||||
raise MethodNotAllowed('post', self.root_org_readonly_msg)
|
|
||||||
return super().update(request, *args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
class OrgModelViewSet(CommonApiMixin, OrgViewSetMixin, ModelViewSet):
|
class OrgModelViewSet(CommonApiMixin, OrgViewSetMixin, ModelViewSet):
|
||||||
|
|
Loading…
Reference in New Issue