Skip to content

Commit

Permalink
AnnotationList: Allow crossUser deletion if allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed May 10, 2023
1 parent 67d812a commit 6d113fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/AnnotationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d113fc

Please sign in to comment.