mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
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:
parent
ec9a457e3e
commit
6effc94349
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user