summaryrefslogtreecommitdiff
path: root/core/tests
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-13 20:06:20 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-13 20:06:20 +0000
commitaf8c74f6125478450072fd105d54172dcba1bf8e (patch)
tree81016a51efe591f0c421a85c101bd664837b3307 /core/tests
parentd480778108d431b26a2e3413814380943d2d804d (diff)
Fix a bug where parent permissions were not getting inherited to newly
created albums and photos.
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/Access_Helper_Test.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/tests/Access_Helper_Test.php b/core/tests/Access_Helper_Test.php
index 7f5aa656..9b08b2cd 100644
--- a/core/tests/Access_Helper_Test.php
+++ b/core/tests/Access_Helper_Test.php
@@ -81,6 +81,23 @@ class Access_Helper_Test extends Unit_Test_Case {
$item->delete();
}
+ public function new_photos_inherit_parent_permissions_test() {
+ $root = ORM::factory("item", 1);
+
+ $album = ORM::factory("item");
+ $album->type = "album";
+ $album->add_to_parent($root);
+ access::add_item($album);
+ access::allow(group::everybody(), "view", $album);
+
+ $photo = ORM::factory("item");
+ $photo->type = "photo";
+ $photo->add_to_parent($album);
+ access::add_item($photo);
+
+ $this->assert_true($photo->__get("view_" . group::everybody()->id));
+ }
+
public function can_allow_deny_and_reset_intent_test() {
$root = ORM::factory("item", 1);
$item = ORM::factory("item")->add_to_parent($root);