Added better ACL group support. More checks are now performed to ensure
that users cannot create jobs against hosts that are not visible, and
that users cannot abort other users' jobs.
Note: If applying this patch, you must also apply the "move logged-in user
tracking to separate thread_local module" patch.
Risk: medium (disallowing actions may have unintended side effects)
Visibility: medium (new errors will occur if disallowed actions are
attempted)
Signed-off-by: James Ren <jamesren@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1797 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/apache_auth.py b/frontend/apache_auth.py
index f8a887e..a74dda3 100644
--- a/frontend/apache_auth.py
+++ b/frontend/apache_auth.py
@@ -31,8 +31,9 @@
@staticmethod
def check_afe_user(username):
- user, _ = models.User.objects.get_or_create(login=username)
- user.save()
+ user, created = models.User.objects.get_or_create(login=username)
+ if created:
+ user.save()
def get_user(self, user_id):
try: