Ensure _acl is updated when _rperm and _wperm updated (#2701)
* Ensure _acl is updated when _rperm and _wperm updated * alternative solution * Only try to apply $set for permission updates
This commit is contained in:
committed by
Florent Vilmart
parent
f6312a1b98
commit
0773523bc2
@@ -330,8 +330,8 @@ const parseObjectToMongoObjectForCreate = (className, restCreate, schema) => {
|
||||
// Main exposed method to help update old objects.
|
||||
const transformUpdate = (className, restUpdate, parseFormatSchema) => {
|
||||
let mongoUpdate = {};
|
||||
let acl = addLegacyACL(restUpdate)._acl;
|
||||
if (acl) {
|
||||
let acl = addLegacyACL(restUpdate);
|
||||
if (acl._rperm || acl._wperm || acl._acl) {
|
||||
mongoUpdate.$set = {};
|
||||
if (acl._rperm) {
|
||||
mongoUpdate.$set._rperm = acl._rperm;
|
||||
|
||||
Reference in New Issue
Block a user