aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SharingManager.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util/SharingManager.tsx')
-rw-r--r--src/client/util/SharingManager.tsx24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 40a282db0..aa9fc4433 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -82,6 +82,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 overridePrivate: boolean = false; // whether child docs in a collection/dashboard should be changed to be less private
@observable private myDocAcls: boolean = false; // whether the My Docs checkbox is selected or not
// private get linkVisible() {
@@ -161,10 +162,12 @@ 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
- var childDocs = DocListCast(target.data)
- childDocs.map(doc => {
- this.setInternalSharing(recipient, permission, doc)
- })
+ if (this.overridePrivate){
+ var childDocs = DocListCast(target.data)
+ childDocs.map(doc => {
+ this.setInternalSharing(recipient, permission, doc)
+ })
+ }
const docs = SelectionManager.Views().length < 2 ? [target] : SelectionManager.Views().map(docView => docView.props.Document);
@@ -200,10 +203,12 @@ 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
- var childDocs = DocListCast(target.data)
- childDocs.map(doc => {
- this.setInternalGroupSharing(group, permission, doc)
- })
+ if (this.overridePrivate){
+ var childDocs = DocListCast(target.data)
+ childDocs.map(doc => {
+ this.setInternalGroupSharing(group, permission, doc)
+ })
+ }
const docs = SelectionManager.Views().length < 2 ? [target] : SelectionManager.Views().map(docView => docView.props.Document);
@@ -275,7 +280,7 @@ export class SharingManager extends React.Component<{}> {
const dashboards = DocListCast(Doc.MyDashboards.data);
docs.forEach(doc => {
const isDashboard = dashboards.indexOf(doc) !== -1;
- this.shareFromPropertiesSidebar(shareWith, permission, DocListCast(doc.data))
+ if (this.overridePrivate) this.shareFromPropertiesSidebar(shareWith, permission, DocListCast(doc.data))
if (GetEffectiveAcl(doc) === AclAdmin) distributeAcls(`acl-${shareWith}`, permission, doc, undefined, undefined, isDashboard);
this.setDashboardBackground(doc, permission as SharingPermissions);
});
@@ -648,6 +653,7 @@ export class SharingManager extends React.Component<{}> {
<div className="acl-container">
{Doc.noviceMode ? null : (
<div className="layoutDoc-acls">
+ <input type="checkbox" onChange={action(() => (this.overridePrivate = !this.overridePrivate))} checked={this.overridePrivate} /> <label>Override Private </label>
<input type="checkbox" onChange={action(() => (this.layoutDocAcls = !this.layoutDocAcls))} checked={this.layoutDocAcls} /> <label>Layout</label>
</div>
)}