From 41590921c3eff2b3425f565f8646b623f9056ad1 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 13 Aug 2022 18:06:30 +0000 Subject: [PATCH] Expose a thing so that the admin app can show permissions. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3955 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/core.js b/core/core.js index eb9ad7ca..a7e5b2e3 100644 --- a/core/core.js +++ b/core/core.js @@ -179,6 +179,9 @@ async function getProcessBlob(blobId, key, options) { return []; } }, + 'permissionsForUser': function(user) { + return (gGlobalSettings?.permissions ? gGlobalSettings.permissions[user] : []) ?? []; + }, 'apps': user => getApps(user, process), 'getSockets': getSockets, 'permissionTest': function(permission) { @@ -756,7 +759,6 @@ function storePermission(user, packageOwner, packageName, permission, allow) { } if (gGlobalSettings.userPermissions[user][packageOwner][packageName][permission] !== allow) { gGlobalSettings.userPermissions[user][packageOwner][packageName][permission] = allow; - print('STORE', JSON.stringify(gGlobalSettings)); setGlobalSettings(gGlobalSettings); } }