I would like a list of all custom roles. Currently I am loading all of them using
$roles = $this->entityManager->getStorage('user_role')->loadMultiple();
but am wondering if there is any function that only brings the custom ones besides manually creating a static filter for the Anonymous, Authenticated and Administrator.
config
table byname LIKE user.role%
) the only potential contender I can see is that the three default ones have a dependency on_core
, so you could check that via getDependencies, but that feels arguably flakier than a static filter to me.