Fix expert user access checks.

Several places in the code, cfg.users.expert() is used as a boolean
test to see if the current user is an expert user.  But this do not work.
Change the implementation of expert() to assume the current user if no
argument is given, to get the code working.
This commit is contained in:
Petter Reinholdtsen committed 2013-09-11 20:11:56 +02:00
1 parent ec9a457e3e
commit 6effc94349
1 file changed
+5
+5
View File
@@ -16,7 +16,12 @@ class UserStore(UserStoreModule, sqlite_db):
def close(self):
self.__exit__(None,None,None)
def currentuser(self):
return cherrypy.session.get(cfg.session_key)
def expert(self, username=None):
if username is None:
username = self.currentuser()
groups = self.attr(username,"groups")
if not groups:
return False