Applied API role specs to short URL creation

This commit is contained in:
Alejandro Celaya
2021-01-04 20:15:42 +01:00
parent 19834f6715
commit 4b67d41362
15 changed files with 314 additions and 7 deletions

View File

@@ -24,10 +24,15 @@ class Role
}
if ($role->name() === self::DOMAIN_SPECIFIC) {
$domainId = $role->meta()['domain_id'] ?? -1;
$domainId = self::domainIdFromMeta($role->meta());
return $inlined ? new BelongsToDomainInlined($domainId) : new BelongsToDomain($domainId);
}
return Spec::andX();
}
public static function domainIdFromMeta(array $meta): string
{
return $meta['domain_id'] ?? '-1';
}
}