private function canUserAssignSectionToSomeContent(Section $section): bool
    {
        $hasAccess = $this->permissionResolver->hasAccess('section', 'assign');

        if (is_bool($hasAccess)) {
            return $hasAccess;
        }

        $restrictedNewSections = $this->permissionChecker->getRestrictions($hasAccess, NewSectionLimitation::class);
        if (!empty($restrictedNewSections)) {
            return in_array($section->id, array_map('intval', $restrictedNewSections), true);
        }

        // If a user has other limitation than NewSectionLimitation, then a decision will be taken later, based on selected Content.
        return true;
    }
private function canUserAssignSectionToSomeContent(Section $section): bool
    {
        $hasAccess = $this->permissionResolver->hasAccess('section', 'assign');

        if (is_bool($hasAccess)) {
            return $hasAccess;
        }

        $restrictedNewSections = $this->permissionChecker->getRestrictions($hasAccess, NewSectionLimitation::class);
        if (!empty($restrictedNewSections)) {
            return in_array($section->id, array_map('intval', $restrictedNewSections), true);
        }

        // If a user has other limitation than NewSectionLimitation, then a decision will be taken later, based on selected Content.
        return true;
    }
private function canUserAssignSectionToSomeContent ( Section $ section ) : bool { $ hasAccess = $ this -> permissionResolver -> hasAccess ( 'section' , 'assign' ) ; if ( is_bool ( $ hasAccess ) ) { return $ hasAccess ; } $ restrictedNewSections = $ this -> permissionChecker -> getRestrictions ( $ hasAccess , NewSectionLimitation :: class ) ; if ( ! empty ( $ restrictedNewSections ) ) { return in_array ( $ section -> id , array_map ( 'intval' , $ restrictedNewSections ) , true ) ; } // If a user has other limitation than NewSectionLimitation, then a decision will be taken later, based on selected Content. return true ; }
Specifies if the User has access to assigning a given Section to Content.

@param \eZ\Publish\API\Repository\Values\Content\Section $section

@return bool

@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
Specifies if the User has access to assigning a given Section to Content .