perf: 修改权限位

pull/9649/head
ibuler 2023-02-21 13:47:47 +08:00
parent 82432299b8
commit 3df411fd61
3 changed files with 10 additions and 5 deletions

View File

@ -13,7 +13,12 @@ class AccountsTaskCreateAPI(CreateAPIView):
serializer_class = serializers.AccountTaskSerializer
def check_permissions(self, request):
return request.user.has_perm('assets.test_assetconnectivity')
act = request.data.get('action')
if act == 'push':
code = 'accounts.push_account'
else:
code = 'accounts.verify_account'
return request.user.has_perm(code)
def perform_create(self, serializer):
data = serializer.validated_data

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad88d17921655f6102ae29c8f1e34c65eac8eb5217a8ba14d189035db156789a
size 135647
oid sha256:014483808a830a01f5432fdc44bc34f7f392e53a160ffa97eb377dbb49e0ec9a
size 135547

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e044950aeb211a81af9d2530f0468b5aa0ffc3acfffd899fbacb78a769b5de59
size 111504
oid sha256:1c1524b6173a2613845d9450d84ef8ca9cf1be6d0f7cdae2a89f6131d6abc1f1
size 111449