Skip to content
Snippets Groups Projects
Commit 17c896ba authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Merge branch 'feature_user_roles' into development

parents 02b6d0c0 dc8274db
No related branches found
No related tags found
1 merge request!116Release v1.0.0
Pipeline #
...@@ -82,7 +82,7 @@ var UserSchema = new Schema({ ...@@ -82,7 +82,7 @@ var UserSchema = new Schema({
origin: { origin: {
type: String, type: String,
enum: ['LDE', 'SimCAQ'], enum: ['LDE', 'SimCAQ'],
required: true required: [true, 'O campo origem é obrigatória e aceita apenas os valores "LDE" ou "SimCAQ"']
}, },
verified: { verified: {
type: Boolean, type: Boolean,
...@@ -93,6 +93,10 @@ var UserSchema = new Schema({ ...@@ -93,6 +93,10 @@ var UserSchema = new Schema({
}, },
citerole: { citerole: {
type: String type: String
},
admin: {
type: Boolean,
default: false
} }
}); });
......
...@@ -137,7 +137,8 @@ userApp.post('/', (req, res, next) => { ...@@ -137,7 +137,8 @@ userApp.post('/', (req, res, next) => {
receiveEmails: false || req.body.receiveEmails, receiveEmails: false || req.body.receiveEmails,
origin: req.body.origin, origin: req.body.origin,
citesegment: req.body.citesegment, citesegment: req.body.citesegment,
citerole: req.body.citerole citerole: req.body.citerole,
admin: false
}); });
if (typeof req.body.password === 'undefined' || !req.body.password) { if (typeof req.body.password === 'undefined' || !req.body.password) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment