Arduino IDE Flatpak Permission Error

I’m trying to use the Arduino IDE and I can’t get it to upload to my devices. I have even tried running the flatpak with --device=all. But, that option doesn’t allow the program to access the serial port to upload my code.

Here is one of the upload errors:
Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.

I have also tried using the Arduino IDE available from DNF in a toolbox but that doesn’t work either.

Perhaps you need su permissions try the command with sudo.

The problem is that when I try to run usermod -aG dialout $USER to add my username to the dialout group the command completes but doesn’t actually add my user to the dialout group.

If I log out and log back in my user didn’t get added to the dialout group.

Check out this post for the underlying problem: How to add myself to the dialout group?