protected function getAccessRootline(Item $item, $language = 0, $contentAccessGroup = null)
    {
        static $accessRootlineCache;

        $mountPointParameter = $this->getMountPageDataUrlParameter($item);

        $accessRootlineCacheEntryId = $item->getRecordUid() . '|' . $language;
        if ($mountPointParameter !== '') {
            $accessRootlineCacheEntryId .= '|' . $mountPointParameter;
        }
        if (!is_null($contentAccessGroup)) {
            $accessRootlineCacheEntryId .= '|' . $contentAccessGroup;
        }

        if (!isset($accessRootlineCache[$accessRootlineCacheEntryId])) {
            $accessRootline = $this->getAccessRootlineByPageId($item->getRecordUid(), $mountPointParameter);

            // current page's content access groups
            $contentAccessGroups = [$contentAccessGroup];
            if (is_null($contentAccessGroup)) {
                $contentAccessGroups = $this->getAccessGroupsFromContent($item, $language);
            }
            $element = GeneralUtility::makeInstance(RootlineElement::class, /** @scrutinizer ignore-type */ 'c:' . implode(',', $contentAccessGroups));
            $accessRootline->push($element);

            $accessRootlineCache[$accessRootlineCacheEntryId] = $accessRootline;
        }

        return $accessRootlineCache[$accessRootlineCacheEntryId];
    }
protected function getAccessRootline(Item $item, $language = 0, $contentAccessGroup = null)
    {
        static $accessRootlineCache;

        $mountPointParameter = $this->getMountPageDataUrlParameter($item);

        $accessRootlineCacheEntryId = $item->getRecordUid() . '|' . $language;
        if ($mountPointParameter !== '') {
            $accessRootlineCacheEntryId .= '|' . $mountPointParameter;
        }
        if (!is_null($contentAccessGroup)) {
            $accessRootlineCacheEntryId .= '|' . $contentAccessGroup;
        }

        if (!isset($accessRootlineCache[$accessRootlineCacheEntryId])) {
            $accessRootline = $this->getAccessRootlineByPageId($item->getRecordUid(), $mountPointParameter);

            // current page's content access groups
            $contentAccessGroups = [$contentAccessGroup];
            if (is_null($contentAccessGroup)) {
                $contentAccessGroups = $this->getAccessGroupsFromContent($item, $language);
            }
            $element = GeneralUtility::makeInstance(RootlineElement::class, /** @scrutinizer ignore-type */ 'c:' . implode(',', $contentAccessGroups));
            $accessRootline->push($element);

            $accessRootlineCache[$accessRootlineCacheEntryId] = $accessRootline;
        }

        return $accessRootlineCache[$accessRootlineCacheEntryId];
    }
protected function getAccessRootline ( Item $ item , $ language = 0 , $ contentAccessGroup = null ) { static $ accessRootlineCache ; $ mountPointParameter = $ this -> getMountPageDataUrlParameter ( $ item ) ; $ accessRootlineCacheEntryId = $ item -> getRecordUid ( ) . '|' . $ language ; if ( $ mountPointParameter !== '' ) { $ accessRootlineCacheEntryId .= '|' . $ mountPointParameter ; } if ( ! is_null ( $ contentAccessGroup ) ) { $ accessRootlineCacheEntryId .= '|' . $ contentAccessGroup ; } if ( ! isset ( $ accessRootlineCache [ $ accessRootlineCacheEntryId ] ) ) { $ accessRootline = $ this -> getAccessRootlineByPageId ( $ item -> getRecordUid ( ) , $ mountPointParameter ) ; // current page's content access groups $ contentAccessGroups = [ $ contentAccessGroup ] ; if ( is_null ( $ contentAccessGroup ) ) { $ contentAccessGroups = $ this -> getAccessGroupsFromContent ( $ item , $ language ) ; } $ element = GeneralUtility :: makeInstance ( RootlineElement :: class , /** @scrutinizer ignore-type */ 'c:' . implode ( ',' , $ contentAccessGroups ) ) ; $ accessRootline -> push ( $ element ) ; $ accessRootlineCache [ $ accessRootlineCacheEntryId ] = $ accessRootline ; } return $ accessRootlineCache [ $ accessRootlineCacheEntryId ] ; }
Generates a page document's "Access Rootline".

The Access Rootline collects frontend user group access restrictions 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 Item $item Index queue item representing the current page
@param int $language The sys_language_uid language ID
@param int $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.
Generates a page document s Access Rootline .