aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-06-15 12:43:58 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-06-15 12:43:58 -0400
commite31f6403bc62faea72767f68d3bf34ac8bd28183 (patch)
tree05802eab3438264c74076b46d1dee91ea697aceb /src/client/views/DocumentDecorations.tsx
parentef953dc11ebe2735bc4d87e2afa272a2c9ff8f78 (diff)
acls distribute properly, documentDecorations shows user effective acl
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 9bc4cb48f..25d70b932 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -165,6 +165,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
@action onContainerDown = (e: React.PointerEvent): void => {
const first = SelectionManager.Views()[0];
const effectiveAcl = GetEffectiveAcl(first.rootDoc);
+ console.log(effectiveAcl)
if (effectiveAcl == AclAdmin || effectiveAcl == AclEdit || effectiveAcl == AclAugment) {
setupMoveUpEvents(
this,
@@ -198,7 +199,12 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
@action
onBackgroundMove = (dragTitle: boolean, e: PointerEvent): boolean => {
- const dragDocView = SelectionManager.Views()[0];
+ const first = SelectionManager.Views()[0];
+ const effectiveAcl = GetEffectiveAcl(first.rootDoc);
+ if (effectiveAcl != AclAdmin && effectiveAcl != AclEdit && effectiveAcl != AclAugment){
+ return false;
+ }
+const dragDocView = SelectionManager.Views()[0];
const containers = new Set<Doc | undefined>();
SelectionManager.Views().forEach(v => containers.add(DocCast(v.rootDoc.embedContainer)));
if (containers.size > 1) return false;
@@ -857,8 +863,9 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
<span className={`documentDecorations-titleSpan${colorScheme}`}>{`${hideTitle ? '' : this.selectionTitle}`}</span>
</div>
);
+
const sharingMenu = docShareMode ? (
- <div className='documentDecorations-share' onPointerDown={e => setupMoveUpEvents(this, e, returnFalse, returnFalse, action(() => SettingsManager.propertiesWidth =250))}>
+ <div className='documentDecorations-share' onPointerDown={e => setupMoveUpEvents(this, e, e => this.onBackgroundMove(true, e), e => {}, action(e => {}))} >
<div className={`documentDecorations-share${shareMode}`}>
<span>{shareSymbolIcon + ' ' + shareMode}</span>
</div>
@@ -899,6 +906,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
{hideDeleteButton ? null : topBtn('close', 'times', undefined, e => this.onCloseClick(true), 'Close')}
{hideResizers || hideDeleteButton ? null : topBtn('minimize', 'window-maximize', undefined, e => this.onCloseClick(undefined), 'Minimize')}
{hideTitle ? null : titleArea}
+ {sharingMenu}
{hideOpenButton ? <div /> : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Lightbox (ctrl: as alias, shift: in new collection)')}
</div>
{hideResizers ? null : (