mirror of https://github.com/jumpserver/jumpserver
fix: api docs
parent
0ef7a9571c
commit
d01d44b48d
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue