protected function shouldShowInNavigation(&$page)
    {
        if (isset($page['rcmOnly'])
            && $page['rcmOnly']
            && empty($this->page)
        ) {
            return false;
        }

        if (isset($page['acl']) && is_array($page['acl'])
            && !empty($page['acl']['resource'])
        ) {
            $privilege = null;
            if (!empty($page['acl']['privilege'])) {
                $privilege = $page['acl']['privilege'];
            }

            $resource = $page['acl']['resource'];

            $resource = str_replace(
                [
                    ':siteId',
                    ':pageName'
                ],
                [
                    $this->currentSite->getSiteId(),
                    $this->page->getName()
                ],
                $resource
            );

            if (!empty($this->page)) {
                $resource = str_replace(
                    [
                        ':siteId',
                        ':pageName'
                    ],
                    [
                        $this->currentSite->getSiteId(),
                        $this->page->getName()
                    ],
                    $resource
                );
            } else {
                $resource = str_replace(
                    [':siteId'],
                    [$this->currentSite->getSiteId()],
                    $resource
                );
            }

            if (!$this->isAllowed->__invoke(
                GetPsrRequest::invoke(),
                $resource,
                $privilege
            )
            ) {
                return false;
            }
        }

        return true;
    }
protected function shouldShowInNavigation(&$page)
    {
        if (isset($page['rcmOnly'])
            && $page['rcmOnly']
            && empty($this->page)
        ) {
            return false;
        }

        if (isset($page['acl']) && is_array($page['acl'])
            && !empty($page['acl']['resource'])
        ) {
            $privilege = null;
            if (!empty($page['acl']['privilege'])) {
                $privilege = $page['acl']['privilege'];
            }

            $resource = $page['acl']['resource'];

            $resource = str_replace(
                [
                    ':siteId',
                    ':pageName'
                ],
                [
                    $this->currentSite->getSiteId(),
                    $this->page->getName()
                ],
                $resource
            );

            if (!empty($this->page)) {
                $resource = str_replace(
                    [
                        ':siteId',
                        ':pageName'
                    ],
                    [
                        $this->currentSite->getSiteId(),
                        $this->page->getName()
                    ],
                    $resource
                );
            } else {
                $resource = str_replace(
                    [':siteId'],
                    [$this->currentSite->getSiteId()],
                    $resource
                );
            }

            if (!$this->isAllowed->__invoke(
                GetPsrRequest::invoke(),
                $resource,
                $privilege
            )
            ) {
                return false;
            }
        }

        return true;
    }
protected function shouldShowInNavigation ( & $ page ) { if ( isset ( $ page [ 'rcmOnly' ] ) && $ page [ 'rcmOnly' ] && empty ( $ this -> page ) ) { return false ; } if ( isset ( $ page [ 'acl' ] ) && is_array ( $ page [ 'acl' ] ) && ! empty ( $ page [ 'acl' ] [ 'resource' ] ) ) { $ privilege = null ; if ( ! empty ( $ page [ 'acl' ] [ 'privilege' ] ) ) { $ privilege = $ page [ 'acl' ] [ 'privilege' ] ; } $ resource = $ page [ 'acl' ] [ 'resource' ] ; $ resource = str_replace ( [ ':siteId' , ':pageName' ] , [ $ this -> currentSite -> getSiteId ( ) , $ this -> page -> getName ( ) ] , $ resource ) ; if ( ! empty ( $ this -> page ) ) { $ resource = str_replace ( [ ':siteId' , ':pageName' ] , [ $ this -> currentSite -> getSiteId ( ) , $ this -> page -> getName ( ) ] , $ resource ) ; } else { $ resource = str_replace ( [ ':siteId' ] , [ $ this -> currentSite -> getSiteId ( ) ] , $ resource ) ; } if ( ! $ this -> isAllowed -> __invoke ( GetPsrRequest :: invoke ( ) , $ resource , $ privilege ) ) { return false ; } } return true ; }
Should link be shown in nav bar?

@param $page

@return bool
Should link be shown in nav bar?