Make ~cory/index/ fail with a better error if not logged in, and require the administrator while I'm at it.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3629 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2021-01-03 20:31:00 +00:00
parent 9cf1d38611
commit bdc9eb6598
2 changed files with 9 additions and 2 deletions

View File

@ -1 +1 @@
{"type":"tildefriends-app","files":{"app.js":"&ovJdMIXT/ocLxZ1rO1N03SpZr3w3RFKCFXl+isnXcx4=.sha256","index.html":"&TFtniuUIVO7XeWCgwmqPAmuBzpGX6slxJQcPMEr+860=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256"}}
{"type":"tildefriends-app","files":{"app.js":"&6uFJG2C0kZar1Aj+7p2/KzYEBXgmK/uJSt7aIJqenN4=.sha256","index.html":"&TFtniuUIVO7XeWCgwmqPAmuBzpGX6slxJQcPMEr+860=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256"}}

View File

@ -368,7 +368,14 @@ core.register('message', async function(m) {
});
async function main() {
if (core.user &&
core.user.credentials &&
core.user.credentials.permissions &&
core.user.credentials.permissions.administration) {
await app.setDocument(utf8Decode(await getFile("index.html")));
} else {
await app.setDocument('<div style="color: #f00">Only the administrator can use this app at this time. Login at the top right.</div>');
}
}
main();