def require(permission): if (not 'auth' in cherrypy.request.cookie ) or cherrypy.request.cookie['auth'].value not in auth.Tokens: raise cherrypy.HTTPRedirect("/login/") if not auth.checkTokenPermission(cherrypy.request.cookie['auth'].value, permission): raise cherrypy.HTTPRedirect("/errors/permissionerror")
def index(self, *path, **data): #Was there a reason not to use pages.require if 'auth' in cherrypy.request.cookie.keys(): if auth.checkTokenPermission(cherrypy.request.cookie['auth'].value, "/admin/mainpage.view"): return pages.get_template('index.html').render( user=cherrypy.request.cookie['user'].value, ) return self.login.index()
def index(self,*path,**data): #Was there a reason not to use pages.require if 'auth' in cherrypy.request.cookie.keys(): if auth.checkTokenPermission(cherrypy.request.cookie['auth'].value,"/admin/mainpage.view"): return pages.get_template('index.html').render( user = cherrypy.request.cookie['user'].value, ) return self.login.index()
def require(permission): if (not 'auth' in cherrypy.request.cookie) or cherrypy.request.cookie['auth'].value not in auth.Tokens: raise cherrypy.HTTPRedirect("/login/") if not auth.checkTokenPermission(cherrypy.request.cookie['auth'].value,permission): raise cherrypy.HTTPRedirect("/errors/permissionerror")