mirror of https://github.com/jumpserver/jumpserver
parent
e32d51253a
commit
ed82249fd1
|
@ -1,4 +1,4 @@
|
||||||
from assets.models import Cloud
|
from assets.models import Cloud, Asset
|
||||||
from assets.serializers import CloudSerializer
|
from assets.serializers import CloudSerializer
|
||||||
|
|
||||||
from .asset import AssetViewSet
|
from .asset import AssetViewSet
|
||||||
|
@ -8,6 +8,7 @@ __all__ = ['CloudViewSet']
|
||||||
|
|
||||||
class CloudViewSet(AssetViewSet):
|
class CloudViewSet(AssetViewSet):
|
||||||
model = Cloud
|
model = Cloud
|
||||||
|
perm_model = Asset
|
||||||
|
|
||||||
def get_serializer_classes(self):
|
def get_serializer_classes(self):
|
||||||
serializer_classes = super().get_serializer_classes()
|
serializer_classes = super().get_serializer_classes()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from assets.models import Database
|
from assets.models import Database, Asset
|
||||||
from assets.serializers import DatabaseSerializer
|
from assets.serializers import DatabaseSerializer
|
||||||
|
|
||||||
from .asset import AssetViewSet
|
from .asset import AssetViewSet
|
||||||
|
@ -8,6 +8,7 @@ __all__ = ['DatabaseViewSet']
|
||||||
|
|
||||||
class DatabaseViewSet(AssetViewSet):
|
class DatabaseViewSet(AssetViewSet):
|
||||||
model = Database
|
model = Database
|
||||||
|
perm_model = Asset
|
||||||
|
|
||||||
def get_serializer_classes(self):
|
def get_serializer_classes(self):
|
||||||
serializer_classes = super().get_serializer_classes()
|
serializer_classes = super().get_serializer_classes()
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
from assets.serializers import DeviceSerializer
|
from assets.serializers import DeviceSerializer
|
||||||
from assets.models import Device
|
from assets.models import Device, Asset
|
||||||
from .asset import AssetViewSet
|
from .asset import AssetViewSet
|
||||||
|
|
||||||
__all__ = ['DeviceViewSet']
|
__all__ = ['DeviceViewSet']
|
||||||
|
@ -8,6 +7,7 @@ __all__ = ['DeviceViewSet']
|
||||||
|
|
||||||
class DeviceViewSet(AssetViewSet):
|
class DeviceViewSet(AssetViewSet):
|
||||||
model = Device
|
model = Device
|
||||||
|
perm_model = Asset
|
||||||
|
|
||||||
def get_serializer_classes(self):
|
def get_serializer_classes(self):
|
||||||
serializer_classes = super().get_serializer_classes()
|
serializer_classes = super().get_serializer_classes()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from assets.models import Host
|
from assets.models import Host, Asset
|
||||||
from assets.serializers import HostSerializer
|
from assets.serializers import HostSerializer
|
||||||
from .asset import AssetViewSet
|
from .asset import AssetViewSet
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ __all__ = ['HostViewSet']
|
||||||
|
|
||||||
class HostViewSet(AssetViewSet):
|
class HostViewSet(AssetViewSet):
|
||||||
model = Host
|
model = Host
|
||||||
|
perm_model = Asset
|
||||||
|
|
||||||
def get_serializer_classes(self):
|
def get_serializer_classes(self):
|
||||||
serializer_classes = super().get_serializer_classes()
|
serializer_classes = super().get_serializer_classes()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from assets.models import Web
|
from assets.models import Web, Asset
|
||||||
from assets.serializers import WebSerializer
|
from assets.serializers import WebSerializer
|
||||||
|
|
||||||
from .asset import AssetViewSet
|
from .asset import AssetViewSet
|
||||||
|
@ -8,6 +8,7 @@ __all__ = ['WebViewSet']
|
||||||
|
|
||||||
class WebViewSet(AssetViewSet):
|
class WebViewSet(AssetViewSet):
|
||||||
model = Web
|
model = Web
|
||||||
|
perm_model = Asset
|
||||||
|
|
||||||
def get_serializer_classes(self):
|
def get_serializer_classes(self):
|
||||||
serializer_classes = super().get_serializer_classes()
|
serializer_classes = super().get_serializer_classes()
|
||||||
|
|
|
@ -36,6 +36,11 @@ exclude_permissions = (
|
||||||
('assets', 'gathereduser', 'add,delete,change', 'gathereduser'),
|
('assets', 'gathereduser', 'add,delete,change', 'gathereduser'),
|
||||||
('assets', 'accountbackupplanexecution', 'delete,change', 'accountbackupplanexecution'),
|
('assets', 'accountbackupplanexecution', 'delete,change', 'accountbackupplanexecution'),
|
||||||
('assets', 'gathereduser', 'add,delete,change', 'gathereduser'),
|
('assets', 'gathereduser', 'add,delete,change', 'gathereduser'),
|
||||||
|
('assets', 'web', '*', '*'),
|
||||||
|
('assets', 'host', '*', '*'),
|
||||||
|
('assets', 'cloud', '*', '*'),
|
||||||
|
('assets', 'device', '*', '*'),
|
||||||
|
('assets', 'database', '*', '*'),
|
||||||
('assets', 'protocol', '*', '*'),
|
('assets', 'protocol', '*', '*'),
|
||||||
('assets', 'systemuser', '*', '*'),
|
('assets', 'systemuser', '*', '*'),
|
||||||
('assets', 'baseautomation', '*', '*'),
|
('assets', 'baseautomation', '*', '*'),
|
||||||
|
|
Loading…
Reference in New Issue