perf: 优化 rbac

This commit is contained in:
ibuler
2023-02-21 13:39:28 +08:00
parent f4cc03434f
commit 0001ffba1b
14 changed files with 86 additions and 28 deletions

View File

@@ -180,9 +180,9 @@ class AssetTaskCreateApi(AssetsTaskMixin, generics.CreateAPIView):
def check_permissions(self, request):
action_perm_require = {
"refresh": "assets.refresh_assethardwareinfo",
"push_account": "accounts.add_pushaccountexecution",
"push_account": "accounts.push_account",
"test": "assets.test_assetconnectivity",
"test_account": "assets.test_account",
"test_account": "accounts.verify_account",
}
_action = request.data.get("action")
perm_required = action_perm_require.get(_action)