@@ -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:true}; | |||
var roles = "user"; | |||
var mail = found.mail; | |||
if (!/\d/.test(mail)) { | |||
// Mail contains no number | |||
roles.author = true; | |||
roles += ",author"; | |||
} | |||
return roles; | |||
return ('{'+roles+'}'); | |||
} | |||
// Fill in session object |