// 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 |