Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Um aplicativo pode testar se o usuário conectado é um administrador registrado do aplicativo. Administrador é um usuário que tem o papel básico de Visualizador, Editor, Proprietário ou
o papel predefinido de Administrador do aplicativo do App Engine.
classAdminPage(webapp2.RequestHandler):defget(self):user=users.get_current_user()ifuser:ifusers.is_current_user_admin():self.response.write('You are an administrator.')else:self.response.write('You are not an administrator.')else:self.response.write('You are not logged in.')
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-03-06 UTC."],[[["The application can verify if the logged-in user is an administrator, which includes users with Viewer, Editor, Owner basic roles, or the App Engine App Admin predefined role."],["The `users.is_current_user_admin` function determines if the current user is an administrator, returning `True` if they are and can only be ran in first-generation runtimes in the App Engine standard environment."],["The provided code example demonstrates how to use the `users.is_current_user_admin` function within a web application to determine if a user has administrator privileges."],["The `login: admin` setting in the configuration file can be utilized to easily restrict access to specific parts of the app to administrators only."]]],[]]