original_string: protected function get_allow_role_control($type) {
          if ($type !== 'assign' and $type !== 'switch' and $type !== 'override' and $type !== 'view') {
              debugging('Invalid role allowed type specified', DEBUG_DEVELOPER);
              return '';
          }
  
          $property = 'allow'.$type;
          $selected = $this->$property;
  
          $options = array();
          foreach (role_get_names(null, ROLENAME_ALIAS) as $role) {
              $options[$role->id] = $role->localname;
          }
          if ($this->roleid == 0) {
              $options[-1] = get_string('thisnewrole', 'core_role');
          }
          return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
              'size' => 10, 'class' => 'form-control'));
      }
code: protected function get_allow_role_control($type) {
          if ($type !== 'assign' and $type !== 'switch' and $type !== 'override' and $type !== 'view') {
              debugging('Invalid role allowed type specified', DEBUG_DEVELOPER);
              return '';
          }
  
          $property = 'allow'.$type;
          $selected = $this->$property;
  
          $options = array();
          foreach (role_get_names(null, ROLENAME_ALIAS) as $role) {
              $options[$role->id] = $role->localname;
          }
          if ($this->roleid == 0) {
              $options[-1] = get_string('thisnewrole', 'core_role');
          }
          return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
              'size' => 10, 'class' => 'form-control'));
      }
code_tokens: protected function get_allow_role_control ( $ type ) { if ( $ type !== 'assign' and $ type !== 'switch' and $ type !== 'override' and $ type !== 'view' ) { debugging ( 'Invalid role allowed type specified' , DEBUG_DEVELOPER ) ; return '' ; } $ property = 'allow' . $ type ; $ selected = $ this -> $ property ; $ options = array ( ) ; foreach ( role_get_names ( null , ROLENAME_ALIAS ) as $ role ) { $ options [ $ role -> id ] = $ role -> localname ; } if ( $ this -> roleid == 0 ) { $ options [ - 1 ] = get_string ( 'thisnewrole' , 'core_role' ) ; } return html_writer :: select ( $ options , 'allow' . $ type . '[]' , $ selected , false , array ( 'multiple' => 'multiple' , 'size' => 10 , 'class' => 'form-control' ) ) ; }
docstring: Returns an array of roles with the allowed type.
  
  @param string $type Must be one of: assign, switch, override or view.
  @return array Am array of role names with the allowed type
docstring_tokens: Returns an array of roles with the allowed type .