From 6d113fcef59ffb635c5935d22d6f06b37ae2081f Mon Sep 17 00:00:00 2001 From: Stefan Peters Date: Wed, 10 May 2023 09:31:49 +0200 Subject: [PATCH] AnnotationList: Allow crossUser deletion if allowed --- src/components/AnnotationList.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/AnnotationList.vue b/src/components/AnnotationList.vue index 2360fa45..ceb984a5 100644 --- a/src/components/AnnotationList.vue +++ b/src/components/AnnotationList.vue @@ -64,9 +64,17 @@ export default { }, }, methods: { - canRemove(annotation) { + userOwnsAnnotation(annotation) { return this.$jskos.annotationCreatorMatches(annotation, this.userUris) }, + canRemove(annotation) { + return !!this.provider?.isAuthorizedFor({ + type: "annotations", + action: "delete", + user: this.user, + crossUser: !this.userOwnsAnnotation(annotation), + }) + }, async remove(index) { if (!this.provider) { return false