Demo: Update author role

This commit is contained in:
2019-07-24 17:42:51 +02:00
parent 2686af2208
commit e063535127
3 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -14,13 +14,13 @@ const clientVisibleSession = { user: true, name: true, type: true, mail: true, r
// Return user role, query from found.mail
function getUserRole(found) {
var roles = "user";
var roles = {user:true};
var mail = found.mail;
if (!/\d/.test(mail)) {
// Mail contains no number
roles += ',"author"';
roles.author = true;
}
return JSON.stringify('{'+roles+'}');
return roles;
}
// Fill in session object