summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/remove.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/remove.pm')
-rw-r--r--IkiWiki/Plugin/remove.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
index 21989aff3..2e3614cca 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 (@) {