forked from cory/tildefriends
Fiddled with saving and loading so that admin users can push and pull to parent apps.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3806 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
15
core/app.js
15
core/app.js
@ -64,6 +64,7 @@ function socket(request, response, client) {
|
||||
var packageName;
|
||||
var blobId;
|
||||
var match;
|
||||
var parentApp;
|
||||
if (match = /^\/([&%][^\.]{44}(?:\.\w+)?)(\/?.*)/.exec(message.path)) {
|
||||
blobId = match[1];
|
||||
} else if (match = /^\/\~([^\/]+)\/([^\/]+)\/$/.exec(message.path)) {
|
||||
@ -74,8 +75,20 @@ function socket(request, response, client) {
|
||||
response.send(JSON.stringify({action: "error", error: message.path + ' not found'}), 0x1);
|
||||
return;
|
||||
}
|
||||
if (user != 'core') {
|
||||
var coreId = await new Database('core').get('path:' + path);
|
||||
parentApp = {
|
||||
path: '/~core/' + path + '/',
|
||||
id: coreId,
|
||||
};
|
||||
}
|
||||
}
|
||||
response.send(JSON.stringify({action: "session", credentials: credentials}), 0x1);
|
||||
response.send(JSON.stringify({
|
||||
action: "session",
|
||||
credentials: credentials,
|
||||
parentApp: parentApp,
|
||||
id: blobId,
|
||||
}), 0x1);
|
||||
|
||||
options.api = message.api || [];
|
||||
options.credentials = credentials;
|
||||
|
Reference in New Issue
Block a user