}
@Override
public GrantRevokeRoleResponse grant_revoke_role(GrantRevokeRoleRequest request)
throws MetaException, org.apache.thrift.TException {
GrantRevokeRoleResponse response = new GrantRevokeRoleResponse();
boolean grantOption = false;
if (request.isSetGrantOption()) {
grantOption = request.isGrantOption();
}
switch (request.getRequestType()) {
case GRANT: {
boolean result = grant_role(request.getRoleName(),
request.getPrincipalName(), request.getPrincipalType(),
request.getGrantor(), request.getGrantorType(), grantOption);
response.setSuccess(result);
break;
}
case REVOKE: {
boolean result = revoke_role(request.getRoleName(), request.getPrincipalName(),
request.getPrincipalType(), grantOption);
response.setSuccess(result);
break;
}
default:
throw new MetaException("Unknown request type " + request.getRequestType());
}