diff options
author | bobzel <zzzman@gmail.com> | 2020-10-06 12:15:49 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-10-06 12:15:49 -0400 |
commit | 68916ee8daafb03ad2aff3338e18ca419ce888de (patch) | |
tree | 061672e28731aeffa87fa76fb6d3af59c43e0865 /src/client/views/DocComponent.tsx | |
parent | 83aaea5320257ce15d68a5299c00977684ddab8e (diff) |
fixed adding documents to check acl of added document(s) correctly
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r-- | src/client/views/DocComponent.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index b3fbe418b..d6f8c49df 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -123,8 +123,9 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps, T @action.bound removeDocument(doc: Doc | Doc[]): boolean { const effectiveAcl = GetEffectiveAcl(this.dataDoc); - const docAcl = GetEffectiveAcl(doc); - if (effectiveAcl === AclEdit || effectiveAcl === AclAdmin || docAcl === AclAdmin) { + const indocs = doc instanceof Doc ? [doc] : doc as Doc[]; + const docs = indocs.filter(doc => effectiveAcl === AclEdit || effectiveAcl === AclAdmin || GetEffectiveAcl(doc) === AclAdmin); + if (docs.length) { const docs = doc instanceof Doc ? [doc] : doc; docs.map(doc => doc.isPushpin = doc.annotationOn = undefined); const targetDataDoc = this.dataDoc; |