}
}
private void grantOrRevokeRole(List<HivePrincipal> principals, List<String> roles,
boolean grantOption, HivePrincipal grantor, boolean isGrant) throws HiveException {
PrincipalType grantorType = AuthorizationUtils.getThriftPrincipalType(grantor.getType());
for (HivePrincipal principal : principals) {
PrincipalType principalType = AuthorizationUtils.getThriftPrincipalType(principal.getType());
String userName = principal.getName();
for (String roleName : roles) {
if (isGrant) {
hive.grantRole(roleName, userName, principalType,
grantor.getName(), grantorType, grantOption);