How to set elevated permission using SETUID?

I’m looking to give my own script permission to run as root using the SETUID similar to how the linux command ‘passwd’ does. Motivation here is to add graphical elements using Zenity to some of my scripts but the script would need to run as root and not ask for the root password because of the lack of a terminal being opened if using Zenity to control the flow.

I wrote a simple script for testing purposes, it contained only one line:

ls /boot/efi

I changed permissions to -rwsr-xr-x. 1 root root.

I expected it to run without asking for a password but alas I was wrong.

ls: cannot open directory '/boot/efi': Permission denied

Am I correct to assume that the failure here is the ‘ls’ command doesn’t inherit a scripts permissions and/or ownership or SETUID ?

Is there a way to safely do what I’m looking to accomplish or is that an endeavor better left alone ?