Skip to content

Commit 0e17b46

Browse files
committedFeb 25, 2022
[members] setup with default permission
1 parent bb9da40 commit 0e17b46

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed
 

‎frontend/express/libs/members.js

+21-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,27 @@ membersUtility.setup = function(req, callback) {
681681
argon2Hash(req.body.password + secret).then(password => {
682682
req.body.email = (req.body.email + "").trim();
683683
req.body.username = (req.body.username + "").trim();
684-
var doc = {"full_name": req.body.full_name, "username": req.body.username, "password": password, "email": req.body.email, "global_admin": true, created_at: Math.floor(((new Date()).getTime()) / 1000), password_changed: Math.floor(((new Date()).getTime()) / 1000)};
684+
var doc = {
685+
"full_name": req.body.full_name,
686+
"username": req.body.username,
687+
"password": password,
688+
"email": req.body.email,
689+
"global_admin": true,
690+
created_at: Math.floor(((new Date()).getTime()) / 1000),
691+
password_changed: Math.floor(((new Date()).getTime()) / 1000),
692+
permission: {
693+
"c": {},
694+
"r": {},
695+
"u": {},
696+
"d": {},
697+
"_": {
698+
"a": [],
699+
"u": [
700+
[]
701+
]
702+
}
703+
}
704+
};
685705
if (req.body.lang) {
686706
doc.lang = req.body.lang;
687707
}

0 commit comments

Comments
 (0)