summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-08-30 15:58:42 -0400
committerJoey Hess <joey@kitenet.net>2010-08-30 15:58:42 -0400
commit75382bd3747f4c293a5fee5715bfbebe0ff04187 (patch)
tree8ad71ac8b383410e294c7cf22376d9e6e5ea0c81
parent7784e0b7b89d2330f507e04fd15dc04027f1eeaf (diff)
factor out check_canedit calls from check_canremove
-rw-r--r--IkiWiki/Plugin/remove.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
index 95f148183..4b527993b 100644
--- a/IkiWiki/Plugin/remove.pm
+++ b/IkiWiki/Plugin/remove.pm
@@ -42,9 +42,6 @@ sub check_canremove ($$$) {
error(sprintf(gettext("%s is not a file"), $file));
}
- # Must be editable.
- IkiWiki::check_canedit($page, $q, $session);
-
# If a user can't upload an attachment, don't let them delete it.
# This is sorta overkill, but better safe than sorry.
if (! defined pagetype($pagesources{$page})) {
@@ -121,6 +118,7 @@ sub removal_confirm ($$@) {
my @pages=@_;
foreach my $page (@pages) {
+ IkiWiki::check_canedit($page, $q, $session);
check_canremove($page, $q, $session);
}
@@ -198,6 +196,7 @@ sub sessioncgi ($$) {
# and that the user is allowed to edit(/remove) it.
my @files;
foreach my $page (@pages) {
+ IkiWiki::check_canedit($page, $q, $session);
check_canremove($page, $q, $session);
# This untaint is safe because of the