If you open a shell from the terminal any changes you make to the file system using chmod/chown will survive a reboot because the FreeNAS system doesn't query its database at boot and enforce any file system permissions that way, however your UI will show something different from what is actually in affect on the system, same goes for any ZFS changes you can do anything to ZFS from the shell (CLI) and it will survive a reboot, however your UI will be out of sync.
And you are right any changes done from the terminal menu will be stored in the DB, however not from the shell.