Prepare read-only check for group library annotations

This commit is contained in:
Martynas Bagdonas 2021-06-08 10:10:21 +03:00
parent 87ef6ceacc
commit 43bd1af3e9
4 changed files with 5 additions and 3 deletions

View file

@ -120,6 +120,9 @@ Zotero.Annotations = new function () {
if (!o.isAuthor) {
o.authorName = Zotero.Users.getName(item.createdByUserID);
}
// TODO: Replace this with the actual code that checks if user is a group admin
let isGroupAdmin = false;
o.readOnly = o.isExternal || (!o.isAuthor && !isGroupAdmin);
if (o.type == 'highlight') {
o.text = item.annotationText;
}

View file

@ -608,7 +608,6 @@ class ReaderInstance {
}
let json = await Zotero.Annotations.toJSON(item);
json.id = item.key;
json.readOnly = !json.isAuthor || json.isExternal;
delete json.key;
for (let key in json) {
json[key] = json[key] || '';

@ -1 +1 @@
Subproject commit c25c3f4f8b40c964ed8eed0c81b2a8845ec1b5ee
Subproject commit e6c7f500e60c474531b7604457f412ab449c2dde

@ -1 +1 @@
Subproject commit 1d8e8ed20b466963192ebf7aa713c1c97e9d89d7
Subproject commit 41f952bccf4e038888791a120e41f0eeae1f2458