diff --git a/apps/perms/api/user_permission/common.py b/apps/perms/api/user_permission/common.py index 003e38856..12469d3da 100644 --- a/apps/perms/api/user_permission/common.py +++ b/apps/perms/api/user_permission/common.py @@ -84,6 +84,8 @@ class ValidateUserAssetPermissionApi(UserAssetPermissionMixin, APIView): system_users_actions = self.util.get_asset_system_users_with_actions( asset) actions = system_users_actions.get(system_user) + if actions is None: + return Response({'msg': False}, status=403) if action_name in Action.value_to_choices(actions): return Response({'msg': True}, status=200) return Response({'msg': False}, status=403) diff --git a/apps/perms/templates/perms/asset_permission_create_update.html b/apps/perms/templates/perms/asset_permission_create_update.html index 4cb5928eb..937e7273e 100644 --- a/apps/perms/templates/perms/asset_permission_create_update.html +++ b/apps/perms/templates/perms/asset_permission_create_update.html @@ -4,6 +4,17 @@ {% load bootstrap3 %} {% block custom_head_css_js %} + {% endblock %} {% block content %} @@ -33,20 +44,55 @@ {% endif %} {% csrf_token %} +