From 606c843a867528a38bdc58bcdea8c657be5de5fa Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Mon, 17 Nov 2008 14:08:04 -0500 Subject: [PATCH] Default to a NULL administrator, instead of the same as the owner svn path=/trunk/packages/invirt-web/; revision=1709 --- code/cache_acls.py | 3 ++- code/controls.py | 2 +- code/validation.py | 6 ++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/code/cache_acls.py b/code/cache_acls.py index 1a23587..7634b7e 100644 --- a/code/cache_acls.py +++ b/code/cache_acls.py @@ -42,7 +42,8 @@ def expandName(name): def accessList(m): people = set() people.update(expandLocker(m.owner)) - people.update(expandName(m.administrator)) + if m.administrator is not None: + people.update(expandName(m.administrator)) return people def refreshMachine(m): diff --git a/code/controls.py b/code/controls.py index 7f5a630..d152627 100644 --- a/code/controls.py +++ b/code/controls.py @@ -90,7 +90,7 @@ def createVm(username, state, owner, contact, name, description, memory, disksiz machine.description = description machine.memory = memory machine.owner = owner - machine.administrator = owner + machine.administrator = None machine.contact = contact machine.uuid = uuidToString(randomUUID()) machine.boot_off_cd = True diff --git a/code/validation.py b/code/validation.py index fe6d7c8..ecd8b9f 100644 --- a/code/validation.py +++ b/code/validation.py @@ -44,9 +44,7 @@ class Validate: owner = testOwner(username, owner, machine) if owner is not None: self.owner = owner - admin = testAdmin(username, admin, machine) - if admin is not None: - self.admin = admin + self.admin = testAdmin(username, admin, machine) contact = testContact(username, contact, machine) if contact is not None: self.contact = contact @@ -218,7 +216,7 @@ def testAdmin(user, admin, machine): if admin is None: return None if machine is not None and admin == machine.administrator: - return None + return admin if admin == user: return admin if ':' not in admin: -- 1.7.9.5