/**
* Returns ancestor of item
*
* @param Permission $item permission instance
* @return array
*/
public function fetchAncestor(Permission $item)
{
$key = $this->getCacheKey($item->siteKey, $item->name, 'ancestor');
if (!($ancestors = $this->cache->get($key))) {
$ancestors = $this->repo->fetchAncestor($item);
if (!empty($ancestors)) {
$this->cache->put($key, $ancestors);
}
}
return $ancestors;
}