try {
List<RolePrincipalGrant> roleGrants = getRoleGrants(principal.getName(),
AuthorizationUtils.getThriftPrincipalType(principal.getType()));
List<HiveRoleGrant> hiveRoleGrants = new ArrayList<HiveRoleGrant>(roleGrants.size());
for (RolePrincipalGrant roleGrant : roleGrants) {
hiveRoleGrants.add(new HiveRoleGrant(roleGrant));
}
return hiveRoleGrants;
} catch (Exception e) {
throw new HiveAuthzPluginException("Error getting role grant information for user "
+ principal.getName() + ": " + e.getMessage(), e);