-
Notifications
You must be signed in to change notification settings - Fork 0
/
rest_feedback_endpoint.install
21 lines (17 loc) · 1.09 KB
/
rest_feedback_endpoint.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
use Drupal\Core\Url;
/**
* Implements hook_install().
*/
function rest_feedback_endpoint_install() {
$messenger = \Drupal::messenger();
// @var \Drupal\Core\Routing\RouteBuilderInterface $routeBuilder $route_builder.
$route_builder = \Drupal::service('router.builder');
// Makes the 'rest_feedback_endpoint.settings' route available here, see hook_install doc.
$route_builder->rebuild();
$messenger->addMessage(t('Thanks for installing the REST Feedback endpoint'));
$messenger->addMessage(t('1. Configure feedback settings at <a href="/admin/config/rest-feedback-endpoint">/admin/config/rest-feedback-endpoint</a>'));
$messenger->addMessage(t('2. Enable the "Submit an Issue" endpoint at <a href="/admin/config/services/rest"">/admin/config/services/rest</a>: <ul><li>Granularity: "resource"</li><li>method: "POST"</li><li>authentication providers: oauth2</li></ul>'));
$messenger->addMessage(t('3. Set Drupal permissions to restrict access to the endpoint by role.'));
$messenger->addMessage(t('4. Make sure your services.yml is set up to handle POST requests (see README.md).'));
}