Expose a user's apps. Baby step to being able to share an app.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3632 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2021-01-06 02:56:25 +00:00
parent 3650cd8350
commit ff4c144be3
2 changed files with 35 additions and 0 deletions

View File

@ -232,6 +232,14 @@ async function getProcessBlob(blobId, key, options) {
},
'getUser': getUser.bind(null, process, process),
'user': getUser(process, process),
'apps': function() {
var apps = process.credentials &&
process.credentials.session &&
process.credentials.session.name ?
new Database(process.credentials.session.name).getLike('path:%') :
{};
return Object.fromEntries(Object.keys(apps).map(key => [key.substring(5), apps[key]]));
},
}
};
if (options.api) {