Esempio n. 1
0
 def deco(*a, **b):
     if hasattr(cherrypy, common.KEY_SESSION):
         user = common.get_logged_user()
         if user is not None and user.is_administrator(
         ) or TvbProfile.is_first_run():
             return func(*a, **b)
     raise common.NotAuthenticated(
         'Only Administrators can access this application area!',
         redirect_url='/tvb')
Esempio n. 2
0
 def deco(*a, **b):
     if hasattr(cherrypy, common.KEY_SESSION):
         if common.get_logged_user():
             return func(*a, **b)
     raise common.NotAuthenticated('Login Required!', redirect_url='/user')