[llvm-commits] [zorg] r125899 - in /zorg/trunk/llvmlab/llvmlab: ui/app.py user.py
Daniel Dunbar
daniel at zuster.org
Fri Feb 18 08:42:36 PST 2011
Author: ddunbar
Date: Fri Feb 18 10:42:36 2011
New Revision: 125899
URL: http://llvm.org/viewvc/llvm-project?rev=125899&view=rev
Log:
llvmlab: Start sketching helpers for working with users / access permissions.
Modified:
zorg/trunk/llvmlab/llvmlab/ui/app.py
zorg/trunk/llvmlab/llvmlab/user.py
Modified: zorg/trunk/llvmlab/llvmlab/ui/app.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/app.py?rev=125899&r1=125898&r2=125899&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/app.py (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/app.py Fri Feb 18 10:42:36 2011
@@ -102,3 +102,12 @@
password + self.config["SECRET_KEY"]).hexdigest()
user = self.config.data.users.get(username)
return user and passhash == user.passhash
+
+ def get_active_user(self):
+ # Lookup the active user.
+ id = flask.session.get('active_user', None)
+ if id is None:
+ return None
+
+ # Return the appropriate user object.
+ return self.config.data.users[id]
Modified: zorg/trunk/llvmlab/llvmlab/user.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/user.py?rev=125899&r1=125898&r2=125899&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/user.py (original)
+++ zorg/trunk/llvmlab/llvmlab/user.py Fri Feb 18 10:42:36 2011
@@ -29,3 +29,11 @@
self.name = name
self.email = email
self.htpasswd = htpasswd
+
+ def has_lab_access(self):
+ """has_lab_access() -> bool
+
+ Is this user allowed access to the lab? Users with lab access can
+ add/modify/remove machines and update other physical lab information.
+ """
+ return True
More information about the llvm-commits
mailing list