Commit 4de937ac by Dányi Bence

webui: permission check for key management

parent 165539ab
......@@ -457,8 +457,7 @@ def key_add(request):
@require_POST
def key_ajax_delete(request):
try:
#TODO: permission check
key=get_object_or_404(SshKey, id=request.POST['id'])
key=get_object_or_404(SshKey, id=request.POST['id'], user=request.user)
key.delete()
except:
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