]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/remove.pm
403 response may be a "not found" too
[git.ikiwiki.info.git] / IkiWiki / Plugin / remove.pm
index ee5784f2026db29ac4d48041f6cd355c2356bf1a..cbc8a0f2ce70719e770fc64853feaaa37252f23b 100644 (file)
@@ -54,6 +54,25 @@ 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 => $page, cgi => $q, session => $session);
+               if (defined $ret) {
+                       if ($ret eq "") {
+                               $canremove=1;
+                       }
+                       elsif (ref $ret eq 'CODE') {
+                               $ret->();
+                               $canremove=0;
+                       }
+                       elsif (defined $ret) {
+                               error($ret);
+                               $canremove=0;
+                       }
+               }
+       });
 }
 
 sub formbuilder_setup (@) {