Skip to content
Snippets Groups Projects
Commit 93b3e431 authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

fix authentification

check if _admin nstead of admin is in list of admins
parent 43867ced
No related branches found
No related tags found
No related merge requests found
function(newDoc, oldDoc, userCtx, secObj) {
if(!userCtx || userCtx.roles.indexOf("admin") == -1 ) {
if(!userCtx || userCtx.roles.indexOf("_admin") == -1 ) {
throw({forbidden: "Bad user userCtx.name="+userCtx.name+" , userCtx.roles="+userCtx.roles});
} else {
if (!newDoc.code) throw({forbidden : "System must have a code"});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment