aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/util/SharingManager.tsx6
-rw-r--r--src/fields/util.ts28
2 files changed, 18 insertions, 16 deletions
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 64b2bb5b8..67b4d9d1a 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -79,7 +79,7 @@ export class SharingManager extends React.Component<{}> {
@observable private showGroupOptions: boolean = false; // // whether to show groups as options when sharing (in the react-select component)
private populating: boolean = false; // whether the list of users is populating or not
@observable private layoutDocAcls: boolean = false; // whether the layout doc or data doc's acls are to be used
- @observable private overrideNested: boolean = false; // whether child docs in a collection/dashboard should be changed to be less private
+ @observable private overrideNested: boolean = false; // whether child docs in a collection/dashboard should be changed to be less private - initially selected so default is override
@observable private myDocAcls: boolean = false; // whether the My Docs checkbox is selected or not
// private get linkVisible() {
@@ -94,6 +94,7 @@ export class SharingManager extends React.Component<{}> {
DictationOverlay.Instance.hasActiveModal = true;
this.isOpen = this.targetDoc !== undefined;
this.permissions = SharingPermissions.Augment;
+ this.overrideNested = true;
});
};
@@ -202,7 +203,7 @@ export class SharingManager extends React.Component<{}> {
const isDashboard = DocListCast(Doc.MyDashboards.data).indexOf(target) !== -1;
// setting the same acl for a docs within the doc being shared if they haven't been set yet
- // or if the 'Override Private' checkbox is selected
+ // or if the 'Override Nested' checkbox is selected
var childDocs = DocListCast(target.data);
childDocs.map(doc => {
if (this.overrideNested || doc[acl] == undefined) {
@@ -457,7 +458,6 @@ export class SharingManager extends React.Component<{}> {
);
this.layoutDocAcls = false;
- this.overrideNested = false;
this.selectedUsers = null;
}
};
diff --git a/src/fields/util.ts b/src/fields/util.ts
index fc0057827..17eb47222 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -287,15 +287,16 @@ export function distributeAcls(key: string, acl: SharingPermissions, target: Doc
let layoutDocChanged = false; // determines whether fetchProto should be called or not (i.e. is there a change that should be reflected in target[AclSym])
// if it is inheriting from a collection, it only inherits if A) the key doesn't already exist or B) the right being inherited is more restrictive
- if (GetEffectiveAcl(target) === AclAdmin && (!inheritingFromCollection || !target[key] || ReverseHierarchyMap.get(StrCast(target[key]))!.level > ReverseHierarchyMap.get(acl)!.level)) {
- target[key] = acl;
- layoutDocChanged = true;
- if (isDashboard) {
- DocListCastAsync(target[Doc.LayoutFieldKey(target)]).then(docs => {
- docs?.forEach(d => distributeAcls(key, acl, d, inheritingFromCollection, visited));
- });
- }
- }
+ // taken care of in SharingManager now so that users can decide if they want nested docs changed
+ // if (GetEffectiveAcl(target) === AclAdmin && (!inheritingFromCollection || !target[key] || ReverseHierarchyMap.get(StrCast(target[key]))!.level > ReverseHierarchyMap.get(acl)!.level)) {
+ // target[key] = acl;
+ // layoutDocChanged = true;
+ // if (isDashboard) {
+ // DocListCastAsync(target[Doc.LayoutFieldKey(target)]).then(docs => {
+ // docs?.forEach(d => distributeAcls(key, acl, d, inheritingFromCollection, visited));
+ // });
+ // }
+ // }
let dataDocChanged = false;
const dataDoc = target[DocData];
@@ -309,10 +310,11 @@ export function distributeAcls(key: string, acl: SharingPermissions, target: Doc
LinkManager.Links(dataDoc).forEach(link => distributeAcls(key, acl, link, inheritingFromCollection, visited));
// maps over the children of the document
- DocListCast(dataDoc[Doc.LayoutFieldKey(dataDoc)]).forEach(d => {
- distributeAcls(key, acl, d, inheritingFromCollection, visited);
- distributeAcls(key, acl, d[DocData], inheritingFromCollection, visited);
- });
+ // taken care of in SharingManager now so that users can decide if they want nested docs changed
+ // DocListCast(dataDoc[Doc.LayoutFieldKey(dataDoc)]).forEach(d => {
+ // distributeAcls(key, acl, d, inheritingFromCollection, visited);
+ // distributeAcls(key, acl, d[DocData], inheritingFromCollection, visited);
+ // });
// maps over the annotations of the document
DocListCast(dataDoc[Doc.LayoutFieldKey(dataDoc) + '_annotations']).forEach(d => {