Fixed wrong domains getting resolved for an API key roles

This commit is contained in:
Alejandro Celaya
2021-07-27 20:03:39 +02:00
committed by Alejandro Celaya
parent 192308a6a3
commit 4ef5ab7a90
7 changed files with 91 additions and 25 deletions

View File

@@ -119,6 +119,11 @@ class ApiKey extends AbstractEntity
return $role?->meta() ?? [];
}
/**
* @template T
* @param callable(string $roleName, array $meta): T $fun
* @return T[]
*/
public function mapRoles(callable $fun): array
{
return $this->roles->map(fn (ApiKeyRole $role) => $fun($role->name(), $role->meta()))->getValues();