Demo: fix
This commit is contained in:
parent
675b9051dc
commit
90c5362a57
@ -14,13 +14,13 @@ const clientVisibleSession = { user: true, name: true, type: true, mail: true, r
|
|||||||
|
|
||||||
// Return user role, query from found.mail
|
// Return user role, query from found.mail
|
||||||
function getUserRole(found) {
|
function getUserRole(found) {
|
||||||
var roles = {user:true};
|
var roles = "user";
|
||||||
var mail = found.mail;
|
var mail = found.mail;
|
||||||
if (!/\d/.test(mail)) {
|
if (!/\d/.test(mail)) {
|
||||||
// Mail contains no number
|
// Mail contains no number
|
||||||
roles.author = true;
|
roles += ",author";
|
||||||
}
|
}
|
||||||
return roles;
|
return ('{'+roles+'}');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill in session object
|
// Fill in session object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user