def _CheckIsDevServer(): if not utils.IsDevelopmentServer(): raise base_handler.Error(500, 'testbackend is only accessible in DEV')
def GetLoginUrl(url): """Gets a URL that accepts a sign-in and then proceeds to the given URL.""" if utils.IsDevelopmentServer(): root_path = config.Get('root_path') or '' return root_path + '/.login?redirect=' + urllib.quote(url) return gae_users.create_login_url(url)
def GetLogoutUrl(url): """Gets a URL that signs the user out and then proceeds to the given URL.""" if utils.IsDevelopmentServer(): root_path = config.Get('root_path') or '' return root_path + '/.login?logout=1&redirect=' + urllib.quote(url) return gae_users.create_logout_url(url)
def IsDeveloper(): """Returns True if running in development or the user is an app admin.""" return utils.IsDevelopmentServer() or gae_users.is_current_user_admin()