$role_list =
implode(',',
$sorted_roles);
$cid = "user_permissions_hash:
$role_list";
if ($static_cache =
$this->static->
get($cid)) { return $static_cache->data;
} else { $tags = Cache::
buildTags('config:user.role',
$sorted_roles, '.'
);
if ($cache =
$this->cache->
get($cid)) { $permissions_hash =
$cache->data;
} else { $permissions_hash =
$this->
doGenerate($sorted_roles);
$this->cache->
set($cid,
$permissions_hash, Cache::PERMANENT,
$tags);
} $this->static->
set($cid,
$permissions_hash, Cache::PERMANENT,
$tags);
} return $permissions_hash;
} /**
* Generates a hash that uniquely identifies the user's permissions.
*
* @param string[] $roles
* The user's roles.
*
* @return string
* The permissions hash.
*/