aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionView.tsx
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-07 15:17:46 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-07 15:17:46 +0800
commite4ee924550052a5be2dcb598587d73434c8f87d8 (patch)
treea87bc2d93116d6cfd12e1eb8459e5fa9364281f0 /src/client/views/collections/CollectionView.tsx
parent79166a51eae57e59cc63009e22310b416500de9e (diff)
parent20149e4849b8c24ba98ea1372f6ab3def6585265 (diff)
Merge branch 'master' into presentation_updates
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
-rw-r--r--src/client/views/collections/CollectionView.tsx20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 6e15cb887..4d1cb670c 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -17,7 +17,7 @@ import { listSpec } from '../../../fields/Schema';
import { ComputedField, ScriptField } from '../../../fields/ScriptField';
import { BoolCast, Cast, NumCast, ScriptCast, StrCast } from '../../../fields/Types';
import { ImageField } from '../../../fields/URLField';
-import { TraceMobx, GetEffectiveAcl, SharingPermissions } from '../../../fields/util';
+import { TraceMobx, GetEffectiveAcl, SharingPermissions, distributeAcls } from '../../../fields/util';
import { emptyFunction, emptyPath, returnEmptyFilter, returnFalse, returnOne, returnZero, setupMoveUpEvents, Utils } from '../../../Utils';
import { Docs, DocUtils } from '../../documents/Documents';
import { DocumentType } from '../../documents/DocumentTypes';
@@ -148,16 +148,14 @@ export class CollectionView extends Touchable<FieldViewProps & CollectionViewCus
return false;
}
else {
- // if (this.props.Document[AclSym]) {
- // // change so it only adds if more restrictive
- // added.forEach(d => {
- // // const dataDoc = d[DataSym];
- // for (const [key, value] of Object.entries(this.props.Document[AclSym])) {
- // // key.substring(4).replace("_", ".") !== Doc.CurrentUserEmail && distributeAcls(key, this.AclMap.get(value) as SharingPermissions, d, true);
- // distributeAcls(key, this.AclMap.get(value) as SharingPermissions, d, true);
- // }
- // });
- // }
+ if (this.props.Document[AclSym]) {
+ added.forEach(d => {
+ for (const [key, value] of Object.entries(this.props.Document[AclSym])) {
+ if (d.author === Doc.CurrentUserEmail && !d.aliasOf) distributeAcls(key, SharingPermissions.Admin, d, true);
+ else distributeAcls(key, this.AclMap.get(value) as SharingPermissions, d, true);
+ }
+ });
+ }
if (effectiveAcl === AclAddonly) {
added.map(doc => Doc.AddDocToList(targetDataDoc, this.props.fieldKey, doc));