Using EffectiveUser instead of ActiveUser

Active user

The user (Google account) that causes a script to execute. Depending on the execution method this may be different from the effective user. You can also think of this as the user at the keyboard.

Effective user

The user (Google account) under whose identity a script executes. Depending on the execution method this may be different than the active user. The permissions of the effective user are used in the execution context.