aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-05-04 15:45:50 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-05-04 15:45:50 -0400
commitabcf1167340f9f411e7712d11f2110625b0938d8 (patch)
tree74619fc06d9654b20a2a65ecf98ed65832698714
parent50876028b994044f2a9426a4efb85a363f0d7168 (diff)
simple checkbox so that users can choose to override more private acl docs
-rw-r--r--src/client/util/SharingManager.scss2
-rw-r--r--src/client/util/SharingManager.tsx24
-rw-r--r--src/client/views/PropertiesView.tsx9
3 files changed, 17 insertions, 18 deletions
diff --git a/src/client/util/SharingManager.scss b/src/client/util/SharingManager.scss
index 3cab77816..aa1e11ef5 100644
--- a/src/client/util/SharingManager.scss
+++ b/src/client/util/SharingManager.scss
@@ -85,11 +85,11 @@
.layoutDoc-acls,
.myDocs-acls {
flex-direction: column;
- margin-right: 12;
label {
font-weight: normal;
font-style: italic;
+ padding-right: 12;
}
input {
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>
)}
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index 984c2dc04..94a6d5639 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -368,14 +368,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
@undoBatch
changePermissions = (e: any, user: string) => {
const docs = (SelectionManager.Views().length < 2 ? [this.selectedDoc] : SelectionManager.Views().map(dv => dv.props.Document)).filter(doc => doc).map(doc => (this.layoutDocAcls ? doc : DocCast(doc)[DataSym]));
- if (user=="Public"){
- // docs[0]['acl-' +user] = e.currentTarget.value as SharingPermissions;
- SharingManager.Instance.shareFromPropertiesSidebar(user, e.currentTarget.value as SharingPermissions, docs);
- }
- else{
-
- SharingManager.Instance.shareFromPropertiesSidebar(user, e.currentTarget.value as SharingPermissions, docs);
- }
+ SharingManager.Instance.shareFromPropertiesSidebar(user, e.currentTarget.value as SharingPermissions, docs);
};
/**