PHP 5는 지원이 종료되었으며 2026년 1월 31일에 지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 PHP 5 애플리케이션을 배포할 수 없습니다. 기존 PHP 5 애플리케이션은 지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다. 지원되는 최신 PHP 버전으로 마이그레이션하는 것이 좋습니다.
애플리케이션은 현재 로그인한 사용자가 애플리케이션에 등록된 관리자인지 여부를 테스트할 수 있습니다. 관리자는 애플리케이션의 관리 콘솔에 액세스할 수 있는 사용자입니다. 관리 콘솔을 사용하여 관리자 역할이 있는 사용자를 관리할 수 있습니다.
현재 사용자가 애플리케이션의 관리자인 경우 UserService::isCurrentUserAdmin() 함수가 True를 반환합니다.
use google\appengine\api\users\User;
$user = UserService::getCurrentUser();if (isset($user) && UserService::isCurrentUserAdmin()) { return 'Welcome administrator.';}return 'You are not an administrator.';
팁: URL 핸들러의 login: adminlogin: admin 구성 요소를 사용하면 애플리케이션의 일부에 대한 액세스 권한을 관리자로 손쉽게 제한할 수 있습니다. 앱 구성을 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eApplications can check if the currently signed-in user has administrator privileges.\u003c/p\u003e\n"],["\u003cp\u003eAdministrators have access to the application's Administration Console for management tasks.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUserService::isCurrentUserAdmin()\u003c/code\u003e function determines if the current user is an administrator, returning \u003ccode\u003eTrue\u003c/code\u003e if they are.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elogin: admin\u003c/code\u003e configuration element can restrict access to parts of an application, limiting it to administrators.\u003c/p\u003e\n"]]],[],null,["# Admin Users\n\nAn application can test whether the currently signed-in user is a registered administrator for the application. An administrator is a user who can access [the Administration Console](/appengine/docs/adminconsole) for the application. You can use the Administration Console to manage which users have administrator status.\n| This page describes how to use the legacy bundled services and APIs. This API can only run in first-generation runtimes in the App Engine standard environment. If you are updating to the App Engine PHP 7/8 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/php-differences) to learn about your migration options for legacy bundled services.\n\nThe function UserService::isCurrentUserAdmin() returns `True` if the current user is an administrator for the application. \n\n use google\\appengine\\api\\users\\User;\n\n $user = UserService::getCurrentUser();\n if (isset($user) && UserService::isCurrentUserAdmin()) {\n return 'Welcome administrator.';\n }\n return 'You are not an administrator.';\n\n**Tip:** An easy way to restrict access to a part of your application to administrators is to use the `login: admin` configuration element for the URL handler. See [Configuring an App](/appengine/docs/legacy/standard/php/config/appref)."]]