aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/PropertiesView.tsx')
-rw-r--r--src/client/views/PropertiesView.tsx30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index a5ac58f75..fb21c2db2 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -319,8 +319,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
.filter(permission => !Doc.noviceMode || ![SharingPermissions.View].includes(permission as any))
.map(permission => (
<option className="propertiesView-permisssions-select" key={permission} value={permission}>
- {' '}
- {permission}{' '}
+ {permission}
</option>
))}
</select>
@@ -379,16 +378,19 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
</div>
{/* {name !== "Me" ? this.notifyIcon : null} */}
<div className="propertiesView-sharingTable-item-permission">
- {admin && permission !== 'Owner' ? this.getPermissionsSelect(name, permission) : permission}
+ {this.colorACLDropDown(name, admin, permission, showExpansionIcon)}
{(permission === 'Owner' && name == 'Me') || showExpansionIcon ? this.expansionIcon : null}
</div>
</div>
);
}
- publicACLDropDown(admin: boolean, permission: string, showExpansionIcon?: boolean) {
+ colorACLDropDown(name: string, admin: boolean, permission: string, showExpansionIcon?: boolean) {
var dropDownText = '';
switch (StrCast(permission)) {
+ case 'Admin':
+ dropDownText = '⬢ ';
+ break;
case 'Edit':
dropDownText = '⬢ ';
break;
@@ -402,15 +404,15 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
dropDownText = '▲ ';
break;
}
-
return (
<div>
<div className={'propertiesView-shareDropDown'}>
<div className={`propertiesView-shareDropDown${permission}`}>
<div className="propertiesView-shareDropDown">
{' '}
- {dropDownText} {admin && permission !== 'Owner' ? this.getPermissionsSelect('Public', permission) : permission}
- {permission === 'Owner' || showExpansionIcon ? this.expansionIcon : null}
+ {dropDownText}
+ {admin && permission !== 'Owner' ? this.getPermissionsSelect(name, permission) : permission}
+ {/* {(permission === 'Owner' && name == 'Me') || showExpansionIcon ? this.expansionIcon : null} */}
</div>
</div>
</div>
@@ -437,9 +439,11 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
const docs = SelectionManager.Views().length < 2 ? [this.layoutDocAcls ? docToUse : docToUse?.[DataSym]] : SelectionManager.Views().map(docView => (this.layoutDocAcls ? docView.props.Document : docView.props.Document[DataSym]));
const target = docs[0];
- const effectiveAcls = GetEffectiveAcl(target);
- const showAdmin = effectiveAcls == AclAdmin || docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)] == 'Owner';
-
+ // const effectiveAcls = GetEffectiveAcl(target);
+ // const showAdmin = effectiveAcls == AclAdmin || docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)] == 'Owner';
+ const curUserAcl = docToUse!['acl-' + normalizeEmail(Doc.CurrentUserEmail)]
+ const showAdmin = curUserAcl == 'Admin' || curUserAcl == 'Owner'
+
// users in common between all docs
// const commonKeys: string[] = intersection(...docs.map(doc => doc?.[AclSym] && Object.keys(doc[AclSym]).filter(key => key !== 'acl-Me')));
// const ownerSame = Doc.CurrentUserEmail !== target.author && docs.filter(doc => doc).every(doc => doc.author === docs[0].author);
@@ -480,11 +484,11 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
return (
<div>
{' '}
- Sharing Mode
- <div>{this.publicACLDropDown(showAdmin, StrCast(target['acl-Public']), false)}</div>
+ Sharing Mode for Public / Guest Users
+ <div>{this.colorACLDropDown('Public', showAdmin, StrCast(target['acl-Public']), false)}</div>
<div>
{' '}
- <br></br> Who has access to the Dashboard?{' '}
+ <br></br> Sharing Modes for Individual Users and Groups with Access to the Dashboard{' '}
</div>
<div className="propertiesView-sharingTable">{<div> {tableEntries}</div>}</div>
</div>