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
966139
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;
    }
897228
function canAssignSectionList()
    {
        $access = $this->hasAccessTo( 'section', 'assign' );

        if ( $access['accessWord'] == 'yes' )
        {
            return array( '*' );
        }
        else if ( $access['accessWord'] == 'limited' )
        {
            $allowedSectionIDList = array();
            foreach ( $access['policies'] as $policy )
            {
                if ( isset( $policy['NewSection'] ) )
                {
                    if ( is_array( $policy['NewSection'] ) && !empty( $policy['NewSection'] ) )
                    {
                        $allowedSectionIDList = array_merge( $allowedSectionIDList, $policy['NewSection'] );
                    }
                }
                else
                {
                    return array( '*' );
                }
            }
            $allowedSectionIDList = array_unique( $allowedSectionIDList );
            return $allowedSectionIDList;
        }
        return array();
    }
1205078
public function mapSection($section, $className)
    {
        if (false === class_exists($className)) {
            throw new \InvalidArgumentException('This section class does not exist');
        } elseif (false === is_a($className, 'Supervisor\Configuration\Section', true)) {
            throw new \InvalidArgumentException('This section class must implement Supervisor\Configuration\Section');
        }

        $this->sectionMap[$section] = $className;
    }
1363156
public function setProperty( $section, $key, $value )
	{
		if( !$this->hasSection( $section ) )
			$this->addSection( $section );
		$this->data[$section][$key]	= $value;
		return is_int( $this->write() );
	}
1254838
public function getEntries( $section )
	{
		if( !isset( $this->list[$section] ) )
			throw new InvalidArgumentException( 'Invalid Section "'.$section.'".' );
		return array_values( $this->list[$section] );
	}
809078
protected function yieldContent($section, $default = '')
    {
        return isset($this->scope->sections[$section]) ? $this->scope->sections[$section] : $default;
    }
889912
public function deleteSection(string $section) : SectionedMap
    {
        if ($section === '') {
            throw new \InvalidArgumentException('Arg \'section\' cannot be empty.');
        }
        unset($this->map[$section], $this->arrayAccess[$section]);

        return $this;
    }
1027393
protected function extendSection($section, $content)
    {
        if (isset($this->sections[$section])) {
            $content = str_replace(static::parentPlaceholder($section), $content, $this->sections[$section]);
        }

        $this->sections[$section] = $content;
    }
460217
protected function verifySectionName($section)
    {
        $this->assertion->notEmpty(
            $section,
            'The name of the section must not be empty.'
        );
        $this->assertion->string(
            $section,
            'The name of the section must be a string.'
        );
    }
263607
public function setMainSection(Section $section)
    {
        if ($section === $this->_mainsection) {
            return $this;
        }

        $this->_mainsection = $section;
        $this->_position = 0;
        $this->_level = $section->getLevel();
        $section->setPage($this);

        return $this->setSection($section);
    }
242226
protected function addSection($section, $contents, $overwrite = false)
    {
        if ($overwrite || !isset($this->sections[$section])) {
            $this->sections[$section] = $contents;
        }

        return $this;
    }
121863
public function startSection($section, $content = '')
    {
        if (! empty($content)) {
            $this->extendSection($section, $content);
        } else if (ob_start()) {
            $this->sectionStack[] = $section;
        }
    }
309102
public function setSection(Section $section)
    {
        if ($section !== $this->_mainsection) {
            $this->_mainsection = null;
            $this->_level = $section->getLevel() + 1;
            if (0 === $this->_position) {
                $this->_position = 1;
            }
        }

        $this->_section = $section;

        return $this;
    }
509534
public function setComment( $key, $comment, $section = NULL )
	{
		if( $this->usesSections() )
		{
			if( !$this->hasProperty( $key, $section ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing in Section "'.$section.'".' );
			$this->comments[$section][$key] = $comment;
		}
		else
		{
			if( !$this->hasProperty( $key ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing' );
			$this->comments[$key] = $comment;
		}
		return is_int( $this->write() );
	}
819575
public function findSection($section)
    {
        if (isset($this->sectionMap[$section])) {
            return $this->sectionMap[$section];
        }

        return false;
    }
714006
public function youTryToGetSettingWithinSection($setting, $section)
    {
        $this->responseValue = $this->settingService->section($section)->get($setting, 'null');
    }
9388
public function activate($key, $section = null)
    {
        if (is_null($section)) {
            $pieces = explode('.', $key);
            $section = $pieces[0];
            $key = $pieces[1];
        }
        return $this->model->activateSetting($section, $key);
    }