src/ScContent/Entity/Back/WidgetConfig.php
public function setRoles($roles)
    {
        $widget = $this->widget;
        $newRoles = [];
        foreach ($this->availableRoles as $role) {
            $newRoles[$role] = in_array($role, $roles);
        }
        $widget->setOption('roles', $newRoles);
    }
public function setRoles($roles)
    {
        $widget = $this->widget;
        $newRoles = [];
        foreach ($this->availableRoles as $role) {
            $newRoles[$role] = in_array($role, $roles);
        }
        $widget->setOption('roles', $newRoles);
    }
public function setRoles ( $ roles ) { $ widget = $ this -> widget ; $ newRoles = [ ] ; foreach ( $ this -> availableRoles as $ role ) { $ newRoles [ $ role ] = in_array ( $ role , $ roles ) ; } $ widget -> setOption ( 'roles' , $ newRoles ) ; }
This data comes from the form. It is the applicable roles list.

@param  string[] $roles
@return void
This data comes from the form . It is the applicable roles list .