}
}
}
// Check with the IOlapService and try to get a list of roles there.
IOlapService olapService = PentahoSystem.get( IOlapService.class );
if ( olapService != null ) {
MondrianCatalogRepositoryHelper helper =
new MondrianCatalogRepositoryHelper( PentahoSystem.get( IUnifiedRepository.class ) );
String serverName = null;
for ( String name : helper.getOlap4jServers() ) {
PropertyList props = Util.parseConnectString( helper.getOlap4jServerInfo( name ).URL );
if ( props.get( RolapConnectionProperties.Catalog.name(), "" ).equals( context ) ) {
serverName = name;
}
}
if ( serverName != null ) {
OlapConnection conn = null;
try {
// Use a null session for root access.
conn = olapService.getConnection( serverName, null );
List<String> roleList = conn.getAvailableRoleNames();
String[] roleArray = roleList.toArray( new String[roleList.size()] );
Arrays.sort( roleArray );
return roleArray;
} catch ( OlapException e ) {