From 09b8c29e2f3237bf35247958d3092fe29c8d72d1 Mon Sep 17 00:00:00 2001 From: KernelDeimos <7225168+KernelDeimos@users.noreply.github.com> Date: Wed, 3 Dec 2025 18:49:31 -0500 Subject: [PATCH] tweak: avoid use of puter global in Perms module --- src/puter-js/src/index.js | 1 + src/puter-js/src/modules/Perms.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/puter-js/src/index.js b/src/puter-js/src/index.js index 70528b0a1..51f734bdb 100644 --- a/src/puter-js/src/index.js +++ b/src/puter-js/src/index.js @@ -458,6 +458,7 @@ const puterInit = (function () { registerModule (name, cls, parameters = {}) { const instance = new cls(this.context, parameters); + instance.puter = this; this.modules_.push(name); this[name] = instance; if ( instance._init ) instance._init({ puter: this }); diff --git a/src/puter-js/src/modules/Perms.js b/src/puter-js/src/modules/Perms.js index c43fe4b8b..5e555f173 100644 --- a/src/puter-js/src/modules/Perms.js +++ b/src/puter-js/src/modules/Perms.js @@ -131,7 +131,7 @@ export default class Perms { permission: `user:${whoami.uuid}:email:read`, }); if ( granted ) { - whoami = await puter.auth.whoami(); + whoami = await this.puter.auth.whoami(); } return whoami.email; }