How to make a field editable under a certain condition?

Hi all,
is it possible in Drupal8 to make a field of a custom content-type editable under a condition?
The value of the condition is the result of a function.

Thank you very much

cld

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed