Write access to /etc or /var


can someone explain if there is a solution for flatpak apps to gain write access to /etc or /var on the host system?

I’ll try to explain the background - I am trying to develop a re-write of system-config-samba, a tool that can be used to configure samba on Linux and create shares using a GUI. The original wrote directly to /etc/samba/smb.conf. Meanwhile, samba offers a mechanism called “usershares” which allows non-root users to configure shares by placing config files in /var/lib/samba/usershares.

I’d like to deploy this app using flatpak. Therefore I am looking for a way to write to either /etc/samba/smb.conf or /var/lib/samba/usershares/username.conf.

Is this at all possible?