diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-26 19:59:51 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-26 19:59:51 -0800 |
commit | df5da84ebb6e35b4e56b6344284d985a7c11ad68 (patch) | |
tree | 93477e33222f6327dc924884c9fee8351dbde71a /modules | |
parent | 0de067312e375fae00d63b99d280aa796f043c22 (diff) | |
parent | f5b9742e2bbce7f30519c9e0b5ce196863dc0707 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/tests/Access_Helper_Test.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php index b2244766..298dd0ac 100644 --- a/modules/gallery/tests/Access_Helper_Test.php +++ b/modules/gallery/tests/Access_Helper_Test.php @@ -203,6 +203,18 @@ class Access_Helper_Test extends Unit_Test_Case { $this->assert_true(access::group_can(identity::everybody(), "view", $album)); } + public function view_permissions_propagate_down_to_photos_test() { + $album = album::create(item::root(), rand(), "test album"); + $photo = photo::create($album, MODPATH . "gallery/images/gallery.png", "", ""); + identity::set_active_user(identity::guest()); + + $this->assert_true(access::can("view", $photo)); + access::deny(identity::everybody(), "view", $album); + + $photo->reload(); // view permissions are cached in the photo + $this->assert_false(access::can("view", $photo)); + } + public function can_toggle_view_permissions_propagate_down_test() { $root = ORM::factory("item", 1); $album1 = album::create($root, rand(), "test album"); |