<?php
$cache = $context->plugin->getCache();
if (!$cached = $cache->get('permissions')) {
    $permissions = array();
    $this->pluginManager->dispatch('UserAdminRolePermissions', array(&$permissions));
    ksort($permissions, SORT_LOCALE_STRING);
    $cache->save(serialize($permissions), 'permissions');
} else {
    $permissions = unserialize($cached);
}