This is a general permission to be able to access ALL guzzlenodes/external APIs (but not use them - you will need to specify usernames/roles inside EACH guzzlenode). Note 1: this ENABLES/DISABLES everything for everyone.So, you MUST have this permission in order to do anything. Note 2: From "RESTful Web Services" you can further control access to Drupal GET,POST,PATCH REST points. The final check is done when you check if the current USERNAME is declared in the specific guzzlenode
- Give permissions /admin/people/permissions to Drupal REST -> from here allow GET,POST,PATCH REST access to this drupal guzzlenode
...
...
@@ -47,15 +47,39 @@ this will relay/forward your request as :
## Usage external-client-side #2:
###Parameters :
-
-
-
##To Do:
### Forward POST
If you POST to the
**http://mydrupal.com/api/relay/post/3**
and you have POST/Payload body forward enabled then, the body you have post will be forwarded to the external API call.
@@ -187,11 +165,17 @@ class GuzzlenodeRestResource extends ResourceBase {
\Drupal::logger('guzzlenode_rest ACCESS debug')->notice("NOOOO we DO NOT have guzzlenode allow access to ext API guzzlenodes PERMISSION");
}else{\Drupal::logger('guzzlenode_rest ACCESS debug')->notice("OK we HAVE guzzlenode allow access to ext API guzzlenodes PERMISSION");}
//$entities = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple(); //ORIG WORKED
$entities=\Drupal::entityTypeManager()
->getStorage('node')
->loadByProperties(['type'=>'guzzle_rest']);//LOAD ONLY guzzle nodes
//->loadMultiple();
//$entities = \Drupal::entityTypeManager()->getStorage('external_entity_type')->loadByProperties(['type' => 'extent001']); // get specific entity JON TEST
//$node_id_from_arg = $nid;
//$node_id_from_alias=\Drupal::service('path.alias_manager')->getAliasByPath('/node/'.$nid); //GET path alias from node_ideg drupal.com/restapi/myalbum
//Todo Do some chech if $nid is number
$node_id_from_alias="0";
//if ($nid!=0)
$node_id_from_alias=\Drupal::service('path.alias_manager')->getPathByAlias('/'.$nid);//GET node_id from path alias drupal.com/restapi/myalbum
...
...
@@ -236,6 +220,7 @@ class GuzzlenodeRestResource extends ResourceBase {
// END of NOW we check extra permissions: @@@@ ________________________________________________________
// Ok Access is allowed. Now we proceed and get the rest settings: