public boolean isUserAdmin(String username, boolean allowAdminIfEmpty) {
        if (adminList == null) {
            loadAdminList();
        }
        if (allowAdminIfEmpty && adminList.isEmpty()) {
            return "admin".equals(username);
        }
        JID userJID = XMPPServer.getInstance().createJID(username, null);
        return adminList.contains(userJID);
    }
Returns true if the user is an admin.

@param username Username of user to check whether they are an admin or not.
@param allowAdminIfEmpty Allows the "admin" user to log in if the adminList is empty.
@return True or false if user is an admin.
xmppserver/src/main/java/org/jivesoftware/openfire/admin/AdminManager.java