mirror of https://github.com/jumpserver/jumpserver
parent
5d022c7056
commit
55e1ef116b
|
@ -30,7 +30,7 @@ class AccountViewSet(OrgBulkModelViewSet):
|
||||||
'partial_update': ['accounts.change_account'],
|
'partial_update': ['accounts.change_account'],
|
||||||
'su_from_accounts': 'accounts.view_account',
|
'su_from_accounts': 'accounts.view_account',
|
||||||
'username_suggestions': 'accounts.view_account',
|
'username_suggestions': 'accounts.view_account',
|
||||||
'remove_secret': 'accounts.change_account',
|
'clear_secret': 'accounts.change_account',
|
||||||
}
|
}
|
||||||
|
|
||||||
@action(methods=['get'], detail=False, url_path='su-from-accounts')
|
@action(methods=['get'], detail=False, url_path='su-from-accounts')
|
||||||
|
@ -73,8 +73,8 @@ class AccountViewSet(OrgBulkModelViewSet):
|
||||||
usernames = common + others
|
usernames = common + others
|
||||||
return Response(data=usernames)
|
return Response(data=usernames)
|
||||||
|
|
||||||
@action(methods=['patch'], detail=False, url_path='remove-secret')
|
@action(methods=['patch'], detail=False, url_path='clear-secret')
|
||||||
def remove_secret(self, request, *args, **kwargs):
|
def clear_secret(self, request, *args, **kwargs):
|
||||||
account_ids = request.data.get('account_ids', [])
|
account_ids = request.data.get('account_ids', [])
|
||||||
self.model.objects.filter(id__in=account_ids).update(secret=None)
|
self.model.objects.filter(id__in=account_ids).update(secret=None)
|
||||||
return Response(status=HTTP_200_OK)
|
return Response(status=HTTP_200_OK)
|
||||||
|
|
Loading…
Reference in New Issue