return check
+def auth_protect(fn):
+ def check(self, *args, **kwargs):
+ if UserSession().get_user().is_anonymous:
+ raise cherrypy.HTTPRedirect(self.basepath)
+ else:
+ return fn(self, *args, **kwargs)
+
+ return check
+
+
class Page(Log):
def __init__(self, site, form=False):
if 'template_env' not in site:
if len(args) > 0:
op = getattr(self, args[0], None)
- if callable(op) and getattr(self, args[0]+'.exposed', None):
+ if callable(op) and getattr(op, 'public_function', None):
return op(*args[1:], **kwargs)
else:
if self._is_form_page: