/**
  * assert only resources with read grant are returned if the user has no manage right
  */
 public function testSearchResources()
 {
     $readableResoureData = $this->testSaveResource();
     $nonReadableResoureData = $this->testSaveResource(array());
     $filer = array(array('field' => 'name', 'operator' => 'in', 'value' => array($readableResoureData['name'], $nonReadableResoureData['name'])));
     $searchResultManager = $this->_uit->searchResources($filer, array());
     $this->assertEquals(2, count($searchResultManager['results']), 'with manage grants all records should be found');
     // steal manage right and reactivate container checks
     $roleManager = Tinebase_Acl_Roles::getInstance();
     $roleManager->deleteRoles(array($roleManager->getRoleByName('manager role')->getId(), $roleManager->getRoleByName('admin role')->getId()));
     Calendar_Controller_Resource::getInstance()->doContainerACLChecks(TRUE);
     $searchResult = $this->_uit->searchResources($filer, array());
     $this->assertEquals(1, count($searchResult['results']), 'without manage grants only one record should be found');
 }