Commit 38254022 authored by Ujvari Gergely's avatar Ujvari Gergely

Bugfix for #354: Added auth check for cascade delete and using flattenChildren() instead of replies

parent daa14376
......@@ -300,9 +300,11 @@ class Annotation
if replies == 0 or $scope.form.privacy.$viewValue is 'Private'
# If we're deleting it without asking for a message, confirm first.
if confirm "Are you sure you want to delete this annotation?"
if $scope.form.privacy.$viewValue is 'Private'
if $scope.form.privacy.$viewValue is 'Private' and replies
#Cascade delete its children
for reply in replies
for reply in $scope.thread.flattenChildren()
if annotator.plugins?.Permissions? and
annotator.plugins.Permissions.authorize 'delete', reply
annotator.deleteAnnotation reply
annotator.deleteAnnotation annotation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment