mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
fix(accounts): owners given before one owner was the rule keep editable rights
With "Multiple Owner for VM" turned off after a VM was given two owners, changing either owner's rights (Delete the VM, say) was refused: the form's one-owner check counted the other owner. The check now applies to a new owner only, as its message says. The user and group forms showed the permissions by the English names the database keeps (Can clone instances, ...), in every language; they are named in the user's language now.
This commit is contained in:
parent
dde7672375
commit
35a5bbdb62
10 changed files with 151 additions and 100 deletions
|
|
@ -329,6 +329,12 @@ class SingleOwnerEditTests(TestCase):
|
|||
self.assertRedirects(response, reverse("accounts:account", args=[bob.pk]), fetch_redirect_response=False)
|
||||
ui.refresh_from_db()
|
||||
self.assertTrue(ui.is_vnc)
|
||||
# owners given while more were allowed: each one's rights still change
|
||||
carol = UserInstance.objects.create(user=get_user_model().objects.create_user("carol"), instance=vm)
|
||||
response = self.client.post(reverse("accounts:user_instance_update", args=[carol.pk]), {"is_delete": "on"})
|
||||
self.assertRedirects(response, reverse("accounts:account", args=[carol.user.pk]), fetch_redirect_response=False)
|
||||
carol.refresh_from_db()
|
||||
self.assertTrue(carol.is_delete)
|
||||
|
||||
|
||||
class OwnerRightsReturnTestCase(TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue