/** * Gets a comma separated list of frontend user groups to use for the * document ID. * * @return string A comma separated list of frontend user groups. */ protected function getDocumentIdGroups() { $groups = $this->pageAccessRootline->getGroups(); $groups = Tx_Solr_Access_Rootline::cleanGroupArray($groups); if (empty($groups)) { $groups[] = 0; } $groups = implode(',', $groups); return $groups; }
/** * Generates a page document's "Access Rootline". * * The Access Rootline collects frontend user group access restrcitions set * for pages up in a page's rootline extended to sub-pages. * * The format is like this: * pageId1:group1,group2|groupId2:group3|c:group1,group4,groupN * * The single elements of the access rootline are separated by a pipe * character. All but the last elements represent pages, the last element * defines the access restrictions applied to the page's content elements * and records shown on the page. * Each page element is composed by the page ID of the page setting frontend * user access restrictions, a colon, and a comma separated list of frontend * user group IDs restricting access to the page. * The content access element does not have a page ID, instead it replaces * the ID by a lower case C. * * @param Tx_Solr_IndexQueue_Item $item Index queue item representing the current page * @param integer $language The sys_language_uid language ID * @param integer $contentAccessGroup The user group to use for the content access rootline element. Optional, will be determined automatically if not set. * @return string An Access Rootline. */ protected function getAccessRootline(Tx_Solr_IndexQueue_Item $item, $language = 0, $contentAccessGroup = null) { static $accessRootlineCache; $accessRootlineCacheEntryId = $item->getRecordUid() . '|' . $language; if (!is_null($contentAccessGroup)) { $accessRootlineCacheEntryId .= '|' . $contentAccessGroup; } if (!isset($accessRootlineCache[$accessRootlineCacheEntryId])) { $accessRootline = Tx_Solr_Access_Rootline::getAccessRootlineByPageId($item->getRecordUid()); // current page's content access groups $contentAccessGroups = array($contentAccessGroup); if (is_null($contentAccessGroup)) { $contentAccessGroups = $this->getAccessGroupsFromContent($item, $language); } $accessRootline->push(t3lib_div::makeInstance('Tx_Solr_Access_RootlineElement', 'c:' . implode(',', $contentAccessGroups))); $accessRootlineCache[$accessRootlineCacheEntryId] = $accessRootline; } return $accessRootlineCache[$accessRootlineCacheEntryId]; }