mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-22 20:09:54 +00:00
revert: 还原api限制
This commit is contained in:
@@ -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):
|
||||||
|
Reference in New Issue
Block a user