def require_super_admin(handler):
 def test_super_admin(self, **kwargs):
  'Checks if the user is logged in and is a super admin.'
  if (not self.user_id):
   self.redirect(current_user_services.create_login_url(self.request.uri))
   return
  if (not current_user_services.is_current_user_super_admin()):
   raise self.UnauthorizedUserException('%s is not a super admin of this application', self.user_id)
  return handler(self, **kwargs)
 return test_super_admin

def require_super_admin ( handler ) : def test_super_admin ( self , ** kwargs ) : if ( not self . user_id ) : self . redirect ( current_user_services . create_login_url ( self . request . uri ) ) return if ( not current_user_services . is_current_user_super_admin ( ) ) : raise self . UnauthorizedUserException ( '%s is not a super admin of this application' , self . user_id ) return handler ( self , ** kwargs ) return test_super_admin
decorator that checks if the current user is a super admin .