@dhyasama/totem-models 8.102.0 → 8.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/helpers.js +4 -0
- package/lib/LimitedPartner.js +4 -4
- package/package.json +1 -1
package/helpers.js
CHANGED
|
@@ -21,8 +21,10 @@ const cleanOrg = module.exports.cleanOrg = function cleanOrg(doc, customerId) {
|
|
|
21
21
|
doc.filters = _.reject(doc.filters, function(item) { return !item || !item.customer || item.customer.toString() !== customerId.toString(); });
|
|
22
22
|
doc.lps = _.reject(doc.lps, function(item) { return !item || !item.customer || item.customer.toString() !== customerId.toString(); });
|
|
23
23
|
doc.valuations = _.reject(doc.valuations, function(item) { return !item || !item.customer || item.customer.toString() !== customerId.toString(); });
|
|
24
|
+
doc.documents = _.reject(doc.documents, function(item) { return !item || !item.customer || item.customer.toString() !== customerId.toString(); });
|
|
24
25
|
doc.operating.acquired.private = _.find(doc.operating.acquired.private, function(item) { return item && item.customer && item.customer.toString() === customerId.toString(); });
|
|
25
26
|
doc.operating.closed.private = _.find(doc.operating.closed.private, function(item) { return item && item.customer && item.customer.toString() === customerId.toString(); });
|
|
27
|
+
|
|
26
28
|
return doc;
|
|
27
29
|
|
|
28
30
|
};
|
|
@@ -39,6 +41,8 @@ const cleanPerson = module.exports.cleanPerson = function cleanPerson(doc, custo
|
|
|
39
41
|
return sourceCustomerId.toString() !== customerId.toString();
|
|
40
42
|
});
|
|
41
43
|
|
|
44
|
+
doc.documents = _.reject(doc.documents, function(item) { return !item || !item.customer || item.customer.toString() !== customerId.toString(); });
|
|
45
|
+
|
|
42
46
|
return doc;
|
|
43
47
|
|
|
44
48
|
};
|
package/lib/LimitedPartner.js
CHANGED
|
@@ -747,13 +747,13 @@ module.exports = function(mongoose, config) {
|
|
|
747
747
|
|
|
748
748
|
LimitedPartner.plugin(filter, {
|
|
749
749
|
'readFilter': {
|
|
750
|
-
'admin': ['name', 'shortName', 'customer', 'start', 'people', 'documentSlugs', 'transactions', 'contact', 'entered', 'status', 'flagged', 'flags', 'notes, details'],
|
|
751
|
-
'lp-full': ['name', 'shortName', 'customer', 'start', 'people', 'documentSlugs', 'transactions', 'contact', 'entered', 'status', 'flagged', 'flags', 'notes, details'],
|
|
750
|
+
'admin': ['name', 'shortName', 'customer', 'start', 'people', 'documentSlugs', 'transactions', 'contact', 'entered', 'status', 'flagged', 'flags', 'notes, details', 'documents'],
|
|
751
|
+
'lp-full': ['name', 'shortName', 'customer', 'start', 'people', 'documentSlugs', 'transactions', 'contact', 'entered', 'status', 'flagged', 'flags', 'notes, details', 'documents'],
|
|
752
752
|
'none': []
|
|
753
753
|
},
|
|
754
754
|
'writeFilter': {
|
|
755
|
-
'admin': ['name', 'shortName', 'customer', 'start', 'people', 'documentSlugs', 'transactions', 'contact', 'entered', 'status', 'flagged', 'flags', 'notes', 'details'],
|
|
756
|
-
'lp-full': ['name', 'shortName', 'customer', 'start', 'people', 'documentSlugs', 'transactions', 'contact', 'entered', 'status', 'flagged', 'flags', 'notes', 'details'],
|
|
755
|
+
'admin': ['name', 'shortName', 'customer', 'start', 'people', 'documentSlugs', 'transactions', 'contact', 'entered', 'status', 'flagged', 'flags', 'notes', 'details', 'documents'],
|
|
756
|
+
'lp-full': ['name', 'shortName', 'customer', 'start', 'people', 'documentSlugs', 'transactions', 'contact', 'entered', 'status', 'flagged', 'flags', 'notes', 'details', 'documents'],
|
|
757
757
|
'none': []
|
|
758
758
|
},
|
|
759
759
|
'defaultFilterRole': 'none',
|