Back out the fix for ticket #452

Revert "Changed access::user_can to force the owner of an item to have"

This reverts commit 0b97cfd6f0.
This commit is contained in:
Tim Almdal
2009-07-27 11:13:20 -07:00
parent 1ec1f19f1a
commit 5fd82a2ede
2 changed files with 3 additions and 56 deletions
@@ -101,48 +101,6 @@ class Access_Helper_Test extends Unit_Test_Case {
$this->assert_false(access::user_can($user, "view", $item), "Should be unable to view");
}
public function owner_can_view_album_test() {
$user = user::create("access_test", "Access Test", "");
foreach ($user->groups as $group) {
$user->remove($group);
}
$user->save();
$root = ORM::factory("item", 1);
$item = album::create($root, rand(), "test album", $user->id);
$this->assert_true(access::user_can($user, "view", $item), "Should be able to view");
}
public function owner_can_view_photo_test() {
$user = user::create("access_test", "Access Test", "");
foreach ($user->groups as $group) {
$user->remove($group);
}
$user->save();
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), "test album", $user->id);
$item = photo::create($album, MODPATH . "gallery/images/gallery.png", "", "", null, $user->id);
$this->assert_true(access::user_can($user, "view", $item), "Should be able to view");
}
public function owner_cant_view_photo_test() {
$user = user::create("access_test", "Access Test", "");
foreach ($user->groups as $group) {
$user->remove($group);
}
$user->save();
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), "test album");
access::deny(group::everybody(), "view", $album);
$item = photo::create($album, MODPATH . "gallery/images/gallery.png", "", "", null, $user->id);
$this->assert_false(access::user_can($user, "view", $item), "Should not be able to view");
}
public function adding_and_removing_items_adds_ands_removes_rows_test() {
$root = ORM::factory("item", 1);
$item = album::create($root, rand(), "test album");