1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

users with can_clone_instances ability are allowed to change_options of vm

This commit is contained in:
Ing. Jan KRCMAR 2017-10-26 15:51:10 +02:00
parent 96674221b4
commit 6d153a6acf
2 changed files with 23 additions and 15 deletions

View file

@ -651,20 +651,6 @@ def instance(request, compute_id, vname):
addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#network')
if 'change_options' in request.POST:
instance.is_template = request.POST.get('is_template', False)
instance.save()
options = {}
for post in request.POST:
if post in ['title', 'description']:
options[post] = request.POST.get(post, '')
conn.set_options(options)
msg = _("Edit options")
addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#options')
if 'add_owner' in request.POST:
user_id = int(request.POST.get('user_id', ''))
@ -727,6 +713,20 @@ def instance(request, compute_id, vname):
addlogmsg(request.user.username, new_instance.name, msg)
return HttpResponseRedirect(reverse('instance', args=[compute_id, clone_data['name']]))
if 'change_options' in request.POST:
instance.is_template = request.POST.get('is_template', False)
instance.save()
options = {}
for post in request.POST:
if post in ['title', 'description']:
options[post] = request.POST.get(post, '')
conn.set_options(options)
msg = _("Edit options")
addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#options')
conn.close()
except libvirtError as lib_err: