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
This commit is contained in:
Cory McWilliams 2022-08-13 18:06:30 +00:00
parent 4d629c45eb
commit 41590921c3

View File

@ -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);
}
}