Commit 4796559f authored by mikeryan's avatar mikeryan Committed by mikeryan

Issue #2803993 by mikeryan: migrate_example_advanced rest resources changed with D8.2.x

parent 391d1ac5
id: migrate_example_advanced_position
plugin_id: 'migrate_example_advanced_position'
granularity: method
configuration:
GET:
supported_formats:
- json
- xml
supported_auth:
- cookie
id: migrate_example_advanced_variety_items
plugin_id: 'migrate_example_advanced_variety_items'
granularity: method
configuration:
GET:
supported_formats:
- json
- xml
supported_auth:
- cookie
id: migrate_example_advanced_variety_list
plugin_id: 'migrate_example_advanced_variety_list'
granularity: method
configuration:
GET:
supported_formats:
- json
- xml
supported_auth:
- cookie
id: migrate_example_advanced_variety_multiple
plugin_id: 'migrate_example_advanced_variety_multiple'
granularity: method
configuration:
GET:
supported_formats:
- json
- xml
supported_auth:
- cookie
......@@ -36,39 +36,6 @@ function migrate_example_advanced_setup_schema() {
* Implements hook_install().
*/
function migrate_example_advanced_setup_install() {
// Enable and configure REST resources providing source data.
$config = \Drupal::configFactory()->getEditable('rest.settings');
$resources = $config->get('resources');
$resources['migrate_example_advanced_position']['GET'] = [
'supported_formats' => ['json', 'xml'],
'supported_auth' => ['cookie'],
];
$resources['migrate_example_advanced_variety_multiple']['GET'] = [
'supported_formats' => ['json', 'xml'],
'supported_auth' => ['cookie'],
];
$resources['migrate_example_advanced_variety_list']['GET'] = [
'supported_formats' => ['json', 'xml'],
'supported_auth' => ['cookie'],
];
$resources['migrate_example_advanced_variety_items']['GET'] = [
'supported_formats' => ['json', 'xml'],
'supported_auth' => ['cookie'],
];
$config->set('resources', $resources);
$config->save();
// Don't require authentication for the services, so the migrations can easily
// be run from drush.
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID,
['restful get migrate_example_advanced_position']);
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID,
['restful get migrate_example_advanced_variety_multiple']);
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID,
['restful get migrate_example_advanced_variety_list']);
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID,
['restful get migrate_example_advanced_variety_items']);
// Populate our tables.
migrate_example_advanced_data_account();
migrate_example_advanced_data_account_updates();
......
......@@ -33,4 +33,12 @@ class PositionResource extends ResourceBase {
return $response;
}
/**
* {@inheritdoc}
*/
public function permissions() {
// Remove permissions so the resource is available to all.
return [];
}
}
......@@ -61,4 +61,12 @@ class VarietyItems extends ResourceBase {
return $response;
}
/**
* {@inheritdoc}
*/
public function permissions() {
// Remove permissions so the resource is available to all.
return [];
}
}
......@@ -31,4 +31,12 @@ class VarietyList extends ResourceBase {
return $response;
}
/**
* {@inheritdoc}
*/
public function permissions() {
// Remove permissions so the resource is available to all.
return [];
}
}
......@@ -72,4 +72,12 @@ class VarietyMultiFiles extends ResourceBase {
return $response;
}
/**
* {@inheritdoc}
*/
public function permissions() {
// Remove permissions so the resource is available to all.
return [];
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment