Fix checking login permissions

This commit is contained in:
JonnyWong16 2018-01-11 23:28:10 -08:00
parent 896a37bea9
commit 547dc9ed33

View file

@ -175,11 +175,11 @@ def requireAuth(*conditions):
# Define those at will however suits the application.
def member_of(user_group):
return cherrypy.request.login['user_group'] == user_group
return lambda: cherrypy.request.login and cherrypy.request.login['user_group'] == user_group
def name_is(user_name):
return cherrypy.request.login['user'] == user_name
return lambda: cherrypy.request.login and cherrypy.request.login['user'] == user_name
# These might be handy