public function isUserAllowedNewsCategory($categoryId)
    {
        if (null === ($roots = $this->getUserAllowedRoots())) {
            return true;
        }

        /** @var Database $db */
        $db = $this->framework->createInstance(Database::class);

        $ids = $db->getChildRecords($roots, 'tl_news_category', false, $roots);
        $ids = \array_map('intval', $ids);

        return \in_array((int) $categoryId, $ids, true);
    }
public function isUserAllowedNewsCategory($categoryId)
    {
        if (null === ($roots = $this->getUserAllowedRoots())) {
            return true;
        }

        /** @var Database $db */
        $db = $this->framework->createInstance(Database::class);

        $ids = $db->getChildRecords($roots, 'tl_news_category', false, $roots);
        $ids = \array_map('intval', $ids);

        return \in_array((int) $categoryId, $ids, true);
    }
public function isUserAllowedNewsCategory ( $ categoryId ) { if ( null === ( $ roots = $ this -> getUserAllowedRoots ( ) ) ) { return true ; } /** @var Database $db */ $ db = $ this -> framework -> createInstance ( Database :: class ) ; $ ids = $ db -> getChildRecords ( $ roots , 'tl_news_category' , false , $ roots ) ; $ ids = \ array_map ( 'intval' , $ ids ) ; return \ in_array ( ( int ) $ categoryId , $ ids , true ) ; }
Return if the user is allowed to manage the news category.

@param int $categoryId

@return bool
Return if the user is allowed to manage the news category .