Careful with that advice.
An individual on an aircraft ... who, by assaulting or intimidating a flight crew member or flight attendant of the aircraft, interferes with the performance of the duties of the member or attendant or lessens the ability of the member or attendant to perform those duties, or attempts or conspires to do such an act, shall be fined under title 18, imprisoned for not more than 20 years, or both.
49 U.S.C. § 46504.
If a flight attendant tells you not to bring peanut products on board and you refuse, you may find yourself arguing what constitutes "intimidation" and "interference" with an airport police officer, who will probably be inclined to let a judge sort it out.