Commit 4de937ac by Dányi Bence

webui: permission check for key management

parent 165539ab
...@@ -457,8 +457,7 @@ def key_add(request): ...@@ -457,8 +457,7 @@ def key_add(request):
@require_POST @require_POST
def key_ajax_delete(request): def key_ajax_delete(request):
try: try:
#TODO: permission check key=get_object_or_404(SshKey, id=request.POST['id'], user=request.user)
key=get_object_or_404(SshKey, id=request.POST['id'])
key.delete() key.delete()
except: except:
messages.error(request, _('Failed to delete public key')) messages.error(request, _('Failed to delete public key'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment