fix: api docs

pull/7976/head
feng626 2022-03-22 11:05:13 +08:00 committed by 老广
parent 0ef7a9571c
commit d01d44b48d
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ class AssetsTaskCreateApi(AssetsTaskMixin, generics.CreateAPIView):
def check_permissions(self, request):
action = request.data.get('action')
action_perm_require = {
'refresh': 'assets.refresh_assethardwareinfo1',
'refresh': 'assets.refresh_assethardwareinfo',
}
perm_required = action_perm_require.get(action)
has = self.request.user.has_perm(perm_required)

View File

@ -16,7 +16,7 @@ class RBACBackend(JMSBaseAuthBackend):
return False
def has_perm(self, user_obj, perm, obj=None):
if not user_obj.is_active:
if not user_obj.is_active or not perm:
raise PermissionDenied()
if perm == '*':
return True