|
|
@@ -65,10 +65,11 @@ module.exports = function(crowi) {
|
|
|
}, {
|
|
|
toObject: {
|
|
|
transform: (doc, ret, opt) => {
|
|
|
+ const isEmailInclude = opt.isEmailInclude || false;
|
|
|
// omit password
|
|
|
delete ret.password;
|
|
|
// omit email
|
|
|
- if (!doc.isEmailPublished) {
|
|
|
+ if (!doc.isEmailPublished && !isEmailInclude) {
|
|
|
delete ret.email;
|
|
|
}
|
|
|
return ret;
|