/**
* Find a registered by type and name
*
* @param string $siteKey site key
* @param string $name target name
* @return Permission
*/
public function findByName($siteKey, $name)
{
$key = $this->getCacheKey($siteKey, $name);
if (!($permission = $this->cache->get($key))) {
if ($permission = $this->repo->findByName($siteKey, $name)) {
$this->cache->put($key, $permission);
}
}
return $permission;
}