filter attributes on space PUT
This commit is contained in:
parent
6f1744bc5d
commit
e25a56e85c
@ -260,8 +260,17 @@ router.put('/:id', function(req, res) {
|
|||||||
newAttr.edit_slug = slug(newAttr['name']);
|
newAttr.edit_slug = slug(newAttr['name']);
|
||||||
|
|
||||||
delete newAttr['_id'];
|
delete newAttr['_id'];
|
||||||
delete newAttr['editor_name'];
|
|
||||||
delete newAttr['creator'];
|
delete newAttr['creator'];
|
||||||
|
delete newAttr['creator_id'];
|
||||||
|
delete newAttr['space_type'];
|
||||||
|
|
||||||
|
if (req['spaceRole'] != "admin") {
|
||||||
|
delete newAttr['access_mode']
|
||||||
|
delete newAttr['password']
|
||||||
|
delete newAttr['edit_hash']
|
||||||
|
delete newAttr['edit_slug']
|
||||||
|
delete newAttr['editors_locking']
|
||||||
|
}
|
||||||
|
|
||||||
db.Space.update(newAttr, {where: {
|
db.Space.update(newAttr, {where: {
|
||||||
"_id": space._id
|
"_id": space._id
|
||||||
|
Loading…
Reference in New Issue
Block a user