diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-07-01 13:22:11 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-07-01 13:22:11 -0400 |
commit | de6ed410bc8edfd558a62eac4536a716027da114 (patch) | |
tree | f164eaa5770312a2b9f410cd1ea56c69cfe01b95 | |
parent | dbf23748dd3bda9f0c520e302876ef280d71f199 (diff) |
reorder
canedit should fail first as it's a less expensive and harder to pass test
-rw-r--r-- | IkiWiki/Plugin/attachment.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 8babe2be2..23862bc05 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -54,6 +54,10 @@ sub formbuilder (@) { #{{{ # The editpage code has already checked that # $form->field('page') is valid. $filename="XXX/$filename"; + + # Also check that the user is allowed to edit it by other + # policies. + IkiWiki::check_canedit($filename, $q, $params{session}, 1); # Use a pagespec to test that the attachment is valid. if (exists $config{valid_attachments} && @@ -65,10 +69,6 @@ sub formbuilder (@) { #{{{ } } - # Also check that the user is allowed to edit it by other - # policies. - IkiWiki::check_canedit($filename, $q, $params{session}, 1); - # Move the attachment into place. # Try to use a fast rename; fall back to copying. prep_writefile($filename, $config{srcdir}); |