aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorgeireann <60007097+geireann@users.noreply.github.com>2020-07-22 22:34:46 +0800
committergeireann <60007097+geireann@users.noreply.github.com>2020-07-22 22:34:46 +0800
commit4a7cdd89b2c026518b577412b087cbeca31b5ff8 (patch)
treef57bc65e0256713a778e4e2bb467cf6d70fca7b2 /src/client/documents/Documents.ts
parent7bacaf22b77197d1760b4cf18a4ee90e86cefa98 (diff)
parent9d530f8fc7ca9621274a38260faebe797f66dd60 (diff)
Merge branch 'master' into presentation_updates
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index d400ecfca..0c1ce8019 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -69,7 +69,7 @@ export interface DocumentOptions {
_showTitle?: string; // which field to display in the title area. leave empty to have no title
_showCaption?: string; // which field to display in the caption area. leave empty to have no caption
_scrollTop?: number; // scroll location for pdfs
- _noAutoscroll?: boolean;// whether collectoins autoscroll when this item is dragged
+ _noAutoscroll?: boolean;// whether collections autoscroll when this item is dragged
_chromeStatus?: string;
_viewType?: string; // sub type of a collection
_gridGap?: number; // gap between items in masonry view
@@ -555,6 +555,11 @@ export namespace Docs {
const dataDoc = MakeDataDelegate(proto, protoProps, data, fieldKey);
const viewDoc = Doc.MakeDelegate(dataDoc, delegId);
+ // so that the list of annotations is already initialised, prevents issues in addonly.
+ // without this, if a doc has no annotations but the user has AddOnly privileges, they won't be able to add an annotation because they would have needed to create the field's list which they don't have permissions to do.
+
+ dataDoc[fieldKey + "-annotations"] = new List<Doc>();
+
proto.links = ComputedField.MakeFunction("links(self)");
viewDoc.author = Doc.CurrentUserEmail;