I am in a need of the Drupal 7 functionality where I could select specific input format for specific field whereas in Drupal 8 this is based on permissions and I really dislike it and for a specific project I need the good old D7 behavior.
Right now I have to alter the input format's static cache during page load to achieve the goal of providing specific input format but it is very bad approach but I haven't found an easy way to do this yet.
Better yet, I need this for my custom form, not even a field but the permissions still apply so Field API has nothing to do with it but rather how the input formats and the text format element are tied together.
FYI this is my solution right now(it is ES service):
$route_name = $this->routeMatch->getRouteName();
$routes = [
...
];
if (in_array($route_name, $routes)) {
filter_formats($this->user);
$formats = &drupal_static('filter_formats', []);
$formats['user'][$this->user->id()] = [
'my_format' => $formats['all']['my_format']
];
}
}