summaryrefslogtreecommitdiff
path: root/core/tests/Access_Helper_Test.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/tests/Access_Helper_Test.php')
-rw-r--r--core/tests/Access_Helper_Test.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/tests/Access_Helper_Test.php b/core/tests/Access_Helper_Test.php
index 6177723b..aaf919b1 100644
--- a/core/tests/Access_Helper_Test.php
+++ b/core/tests/Access_Helper_Test.php
@@ -289,4 +289,32 @@ class Access_Helper_Test extends Unit_Test_Case {
$this->assert_false(file_exists($album->file_path() . "/.htaccess"));
}
+ public function everybody_view_full_permission_maintains_htaccess_files_test() {
+ $root = ORM::factory("item", 1);
+ $album = album::create($root, rand(), "test album");
+
+ $this->assert_false(file_exists($album->file_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
+
+ access::deny(group::everybody(), "view_full", $album);
+ $this->assert_true(file_exists($album->file_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
+
+ access::allow(group::everybody(), "view_full", $album);
+ $this->assert_false(file_exists($album->file_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
+
+ access::deny(group::everybody(), "view_full", $album);
+ $this->assert_true(file_exists($album->file_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
+
+ access::reset(group::everybody(), "view_full", $album);
+ $this->assert_false(file_exists($album->file_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->resize_path() . "/.htaccess"));
+ $this->assert_false(file_exists($album->thumb_path() . "/.htaccess"));
+ }
}