How to add a condition for an array on an entity query for a config entity? I want to execute an entity query on a config entity type. However when I want to add an IN condition on a property which is an array I am getting an error.

For example, I want to retrieve all user roles that have the administer nodes permission:

$query = \Drupal::entityTypeManager()-&gt;getStorage('user_role')-&gt;getQuery();
$query-&gt;condition('permissions', ['administer nodes'], 'IN');
$query-&gt;execute();


This gives the following error:

PHP Warning:  mb_strtolower() expects parameter 1 to be string, array given in core/lib/Drupal/Core/Config/Entity/Query/Condition.php on line 166
A config entity doesn't use a normalized table structure, so the normal array conditions which use JOIN don't work. Instead do a condition on property.*:

$query = \Drupal::entityTypeManager()-&gt;getStorage('user_role')-&gt;getQuery();
$query-&gt;condition('permissions.*', 'administer nodes');
$query-&gt;execute();