private boolean userBelongsToRole(String roleName) throws HiveAuthzPluginException {
    for (HiveRoleGrant role : getRolesFromMS()) {
      // set to one of the roles user belongs to.
      if (role.getRoleName().equalsIgnoreCase(roleName)) {
        return true;
      }
    }
    return false;
  }
@param roleName
@return true if roleName is the name of one of the roles (including the role hierarchy)
that the user belongs to.
@throws HiveAuthzPluginException
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAccessController.java