try {
List<MRoleMap> roleMaps = getMS().listRoles(principalName, principalType);
if (roleMaps != null) {
for (MRoleMap roleMap : roleMaps) {
MRole mrole = roleMap.getRole();
Role role = new Role(mrole.getRoleName(), mrole.getCreateTime(), mrole.getOwnerName());
result.add(role);
}
}
// all users by default belongs to public role
result.add(new Role(PUBLIC,0,PUBLIC));
return result;
} catch (MetaException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);