isAdmin
function isAdmin(): boolean;
The active user is looked up through the Admin SDK Directory service, which the script has to have enabled and be authorised for. Anything that goes wrong — the service missing, the lookup refused — is logged and answered as false, so the call is safe to make from a menu builder.
It is a question about the person running the script, not about a permission on a document.
Returns
boolean — true when the active user is an administrator.
Examples
Gating a feature
if (isAdmin()) {
showAdminMenu();
}
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.