private List<HiveRoleGrant> getRolesFromMS() throws HiveAuthzPluginException {
    try {
      List<RolePrincipalGrant> roles = getRoleGrants(currentUserName, PrincipalType.USER);
      Map<String, HiveRoleGrant> name2Rolesmap = new HashMap<String, HiveRoleGrant>();
      getAllRoleAncestors(name2Rolesmap, roles);
      List<HiveRoleGrant> currentRoles = new ArrayList<HiveRoleGrant>(roles.size());
      for (HiveRoleGrant role : name2Rolesmap.values()) {
        if (!HMSHandler.ADMIN.equalsIgnoreCase(role.getRoleName())) {
          currentRoles.add(role);
        } else {
          this.adminRole = role;
        }
      }
      return currentRoles;
    } catch (Exception e) {
      throw SQLAuthorizationUtils.getPluginException("Failed to retrieve roles for "
          + currentUserName, e);
    }
  }
(Re-)initialize currentRoleNames if necessary.
@throws HiveAuthzPluginException
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLStdHiveAccessController.java