(query, acl)
| 83 | } |
| 84 | |
| 85 | function addReadACL(query, acl) { |
| 86 | const newQuery = _.cloneDeep(query); |
| 87 | //Can't be any existing '_rperm' query, we don't allow client queries on that, no need to $and |
| 88 | newQuery._rperm = { $in: [null, '*', ...acl] }; |
| 89 | return newQuery; |
| 90 | } |
| 91 | |
| 92 | // Transforms a REST API formatted ACL object to our two-field mongo format. |
| 93 | const transformObjectACL = ({ ACL, ...result }) => { |