X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/3547a2a3474b2d5a97c4bc16ea29e81a013b1185..8e738066bc1434f65d2e955e5c080c806a0ec797:/IkiWiki/Plugin/remove.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index ee5784f20..f62bfb1d7 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -54,6 +54,26 @@ sub check_canremove ($$$) { error("renaming of attachments is not allowed"); } } + + my $canremove; + IkiWiki::run_hooks(canremove => sub { + return if defined $canremove; + my $ret=shift->($page, $q, $session); + if (defined $ret) { + if ($ret eq "") { + $canremove=1; + } + elsif (ref $ret eq 'CODE') { + $ret->(); + $canremove=0; + } + elsif (defined $ret) { + error($ret); + $canremove=0; + } + } + }); + return $canremove; } sub formbuilder_setup (@) {