diff --git a/apps/assets/api/asset/cloud.py b/apps/assets/api/asset/cloud.py index 64ab6b738..96211ab6e 100644 --- a/apps/assets/api/asset/cloud.py +++ b/apps/assets/api/asset/cloud.py @@ -1,4 +1,4 @@ -from assets.models import Cloud +from assets.models import Cloud, Asset from assets.serializers import CloudSerializer from .asset import AssetViewSet @@ -8,6 +8,7 @@ __all__ = ['CloudViewSet'] class CloudViewSet(AssetViewSet): model = Cloud + perm_model = Asset def get_serializer_classes(self): serializer_classes = super().get_serializer_classes() diff --git a/apps/assets/api/asset/database.py b/apps/assets/api/asset/database.py index d4f135cbf..136f82f54 100644 --- a/apps/assets/api/asset/database.py +++ b/apps/assets/api/asset/database.py @@ -1,4 +1,4 @@ -from assets.models import Database +from assets.models import Database, Asset from assets.serializers import DatabaseSerializer from .asset import AssetViewSet @@ -8,6 +8,7 @@ __all__ = ['DatabaseViewSet'] class DatabaseViewSet(AssetViewSet): model = Database + perm_model = Asset def get_serializer_classes(self): serializer_classes = super().get_serializer_classes() diff --git a/apps/assets/api/asset/device.py b/apps/assets/api/asset/device.py index f6a457fe4..a2031ef1a 100644 --- a/apps/assets/api/asset/device.py +++ b/apps/assets/api/asset/device.py @@ -1,6 +1,5 @@ - from assets.serializers import DeviceSerializer -from assets.models import Device +from assets.models import Device, Asset from .asset import AssetViewSet __all__ = ['DeviceViewSet'] @@ -8,6 +7,7 @@ __all__ = ['DeviceViewSet'] class DeviceViewSet(AssetViewSet): model = Device + perm_model = Asset def get_serializer_classes(self): serializer_classes = super().get_serializer_classes() diff --git a/apps/assets/api/asset/host.py b/apps/assets/api/asset/host.py index fbc2e997c..d2ddc954d 100644 --- a/apps/assets/api/asset/host.py +++ b/apps/assets/api/asset/host.py @@ -1,4 +1,4 @@ -from assets.models import Host +from assets.models import Host, Asset from assets.serializers import HostSerializer from .asset import AssetViewSet @@ -7,6 +7,7 @@ __all__ = ['HostViewSet'] class HostViewSet(AssetViewSet): model = Host + perm_model = Asset def get_serializer_classes(self): serializer_classes = super().get_serializer_classes() diff --git a/apps/assets/api/asset/web.py b/apps/assets/api/asset/web.py index 92aaeff9b..363fd5f49 100644 --- a/apps/assets/api/asset/web.py +++ b/apps/assets/api/asset/web.py @@ -1,4 +1,4 @@ -from assets.models import Web +from assets.models import Web, Asset from assets.serializers import WebSerializer from .asset import AssetViewSet @@ -8,6 +8,7 @@ __all__ = ['WebViewSet'] class WebViewSet(AssetViewSet): model = Web + perm_model = Asset def get_serializer_classes(self): serializer_classes = super().get_serializer_classes() diff --git a/apps/rbac/const.py b/apps/rbac/const.py index 27381640c..d63c2f610 100644 --- a/apps/rbac/const.py +++ b/apps/rbac/const.py @@ -36,6 +36,11 @@ exclude_permissions = ( ('assets', 'gathereduser', 'add,delete,change', 'gathereduser'), ('assets', 'accountbackupplanexecution', 'delete,change', 'accountbackupplanexecution'), ('assets', 'gathereduser', 'add,delete,change', 'gathereduser'), + ('assets', 'web', '*', '*'), + ('assets', 'host', '*', '*'), + ('assets', 'cloud', '*', '*'), + ('assets', 'device', '*', '*'), + ('assets', 'database', '*', '*'), ('assets', 'protocol', '*', '*'), ('assets', 'systemuser', '*', '*'), ('assets', 'baseautomation', '*', '*'),