def ensureLoggedIn(data): """Ensures that the user is logged in. Args: data: request_data.RequestData for the current request. Raises: exception.LoginRequired: If the user is not logged in. """ if not data.gae_user: raise exception.LoginRequired()
def checkAccess(self, data, check): """See AccessChecker.checkAccess for specification.""" if data.is_developer: # NOTE(nathaniel): Developers are given all the powers of # program administrators. return elif not data.gae_user: raise exception.LoginRequired() elif not user_logic.isHostForProgram(data.ndb_user, data.program.key()): raise exception.Forbidden( message=_MESSAGE_NOT_PROGRAM_ADMINISTRATOR)
def isLoggedIn(self): """Ensures that the user is logged in.""" if not self.data.gae_user: raise exception.LoginRequired()