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:
2021-01-03 20:31:00 +00:00
parent 9cf1d38611
commit bdc9eb6598
2 changed files with 9 additions and 2 deletions

View File

@ -368,7 +368,14 @@ core.register('message', async function(m) {
});
async function main() {
await app.setDocument(utf8Decode(await getFile("index.html")));
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();