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):
|
def check_permissions(self, request):
|
||||||
action = request.data.get('action')
|
action = request.data.get('action')
|
||||||
action_perm_require = {
|
action_perm_require = {
|
||||||
'refresh': 'assets.refresh_assethardwareinfo1',
|
'refresh': 'assets.refresh_assethardwareinfo',
|
||||||
}
|
}
|
||||||
perm_required = action_perm_require.get(action)
|
perm_required = action_perm_require.get(action)
|
||||||
has = self.request.user.has_perm(perm_required)
|
has = self.request.user.has_perm(perm_required)
|
||||||
|
|
|
@ -16,7 +16,7 @@ class RBACBackend(JMSBaseAuthBackend):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def has_perm(self, user_obj, perm, obj=None):
|
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()
|
raise PermissionDenied()
|
||||||
if perm == '*':
|
if perm == '*':
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue