forked from cory/tildefriends
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:
@ -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();
|
Reference in New Issue
Block a user