@@ -35,17 +35,16 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#type'=>'radios',
'#title'=>$this->t('Allowed operations'),
'#options'=>[
1=>$this->t('Accept only JSON:API read operations.'),
0=>$this->t('Accept all JSON:API create, read, update, and delete operations.'),
'r'=>$this->t('Accept only JSON:API read operations.'),
'rw'=>$this->t('Accept all JSON:API create, read, update, and delete operations.'),
],
'#config_target'=>newConfigTarget(
'jsonapi.settings',
'read_only',
// Convert the value to an integer when displaying the config value in
// the form.
'intval',
// Convert the bool config value to an expected string.
fn($value)=>$value?'r':'rw',
// Convert the submitted value to a boolean before storing it in config.
'boolval',
fn($value)=>$value==='r',
),
'#description'=>$this->t('Warning: Only enable all operations if the site requires it. <a href=":docs">Learn more about securing your site with JSON:API.</a>',[':docs'=>'https://www.drupal.org/docs/8/modules/jsonapi/security-considerations']),
'#description'=>$this->t('Enter a different domain from which to serve oEmbed content, including the <em>http://</em> or <em>https://</em> prefix. This domain needs to point back to this site, or existing oEmbed content may not display correctly, or at all.'),
];
@@ -118,17 +118,4 @@ public function buildForm(array $form, FormStateInterface $form_state) {