public static boolean isSuperUser(User user) {
    if (superUsers == null) {
      throw new IllegalStateException(
        "Super users/super groups lists" + " have not been initialized properly.");
    }
    if (user == null) {
      throw new IllegalArgumentException("Null user passed for super user check");
    }
    if (superUsers.contains(user.getShortName())) {
      return true;
    }
    for (String group : user.getGroupNames()) {
      if (superGroups.contains(AuthUtil.toGroupEntry(group))) {
        return true;
      }
    }
    return false;
  }
Check if the current user is a super user
@return true if current user is a super user (whether as user running process, declared as
        individual superuser or member of supergroup), false otherwise.
@param user to check
@throws IllegalStateException if lists of superusers/super groups haven't been initialized
                              properly
hbase-common/src/main/java/org/apache/hadoop/hbase/security/Superusers.java