class AcmPluginManager implements ApplicationContextAware, ApplicationListener<AbstractContextHolderEvent> {

    public List<String> getPrivilegesForRole(String role)
    {
        if (configurablePrivilegesByRole.containsKey(role))
        {
            return Collections.unmodifiableList(configurablePrivilegesByRole.get(role));
        }
        else
        {
            String wildCardRole = StringUtils.substringBeforeLast(role, "@") + "@*";
            if (configurablePrivilegesByRole.containsKey(wildCardRole))
            {
                return Collections.unmodifiableList(configurablePrivilegesByRole.get(wildCardRole));
            }
            else
            {
                return Collections.emptyList();
            }
        }
    }

}