diff options
| author | Melissa Zhang <mzhang19096@gmail.com> | 2020-08-03 15:15:33 -0700 | 
|---|---|---|
| committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-08-03 15:15:33 -0700 | 
| commit | e9737412cb3d60ed76c31c9571e9516518cddd77 (patch) | |
| tree | 407f4a4cbc4947d4057d317dc3a8b7369197c01d /src/client/views/pdf/PDFViewer.tsx | |
| parent | 1713f5415294b996e6dbbe9ca45f0f4511c69824 (diff) | |
| parent | ef5dbc6ad8bdb70f3e68d2fc4ace1a483b031add (diff) | |
merge with master
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
| -rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index c792df882..5a43a076b 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -4,7 +4,7 @@ const pdfjs = require('pdfjs-dist/es5/build/pdf.js');  import * as Pdfjs from "pdfjs-dist";  import "pdfjs-dist/web/pdf_viewer.css";  import { Dictionary } from "typescript-collections"; -import { Doc, DocListCast, FieldResult, HeightSym, Opt, WidthSym } from "../../../fields/Doc"; +import { Doc, DocListCast, FieldResult, HeightSym, Opt, WidthSym, AclAddonly, AclEdit, AclAdmin } from "../../../fields/Doc";  import { documentSchema } from "../../../fields/documentSchemas";  import { Id } from "../../../fields/FieldSymbols";  import { InkTool } from "../../../fields/InkField"; @@ -13,7 +13,7 @@ import { createSchema, makeInterface } from "../../../fields/Schema";  import { ScriptField } from "../../../fields/ScriptField";  import { Cast, NumCast } from "../../../fields/Types";  import { PdfField } from "../../../fields/URLField"; -import { TraceMobx } from "../../../fields/util"; +import { TraceMobx, GetEffectiveAcl } from "../../../fields/util";  import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, emptyFunction, emptyPath, intersectRect, returnZero, smoothScroll, Utils } from "../../../Utils";  import { Docs, DocUtils } from "../../documents/Documents";  import { DocumentType } from "../../documents/DocumentTypes"; @@ -565,9 +565,10 @@ export class PDFViewer extends ViewBoxAnnotatableComponent<IViewerProps, PdfDocu      @action      highlight = (color: string) => {          // creates annotation documents for current highlights -        const annotationDoc = this.makeAnnotationDocument(color); -        annotationDoc && this.props.addDocument?.(annotationDoc); -        return annotationDoc; +        const effectiveAcl = GetEffectiveAcl(this.props.Document); +        const annotationDoc = [AclAddonly, AclEdit, AclAdmin].includes(effectiveAcl) && this.makeAnnotationDocument(color); +        annotationDoc && this.addDocument?.(annotationDoc); +        return annotationDoc as Doc ?? undefined;      }      /** | 
