- Issue created by @Istari
- 🇻🇳Vietnam zipme_hkt
Hi @mysdiir
It nice that you interesting with my ECA quick actions idea.
My idea about ECA quick actions that help me can use exist function in the Drupal and other contrib modules function without need define custom module.
With your idea when create custom annotation in your custom module for quick action you can directly create ECA Action plugin will better.
But for your idea I think we can create other EAC action called
ECA Helper: Quick Service Action
with input are service name, service function name and parameters like current ECA Quick ActionThere are 2 points here:
- User can input any service and function in the Quick Service Action, but it may concern with the security when user can access to any Drupal service.
-In custom module you can create a service with custom tag like "eca_quick_action" the module will automatic scan these service and allow user can select defined with tag "eca_quick_action"Please give me your thought with my above comment.
Best regards. - 🇩🇪Germany Istari
Sry for my late reply.
Your Idea sounds good, so we don't need a custom discovery system, which would lower the complexity.
From a technical and security point of view we need to make sure to drastically limit the user input.My first thought would be something like a switch case that uses the user input from the configuration form to execute function. Something like:
function foo() { echo "foo"; } function bar() { echo "bar"; } $input = "foo"; switch ($input) { case 'foo': foo(); break; case 'bar': bar(); break; default: echo "Error."; }
But I am not sure if this would be a propper way.
Also in terms of security my expertise is too low to determine the conditions to keep it safe and secure.