Thanks for pointing that out. I went back to the first link you posted and looked through it again. That actually was the solution but I just did not understand it when I first read through but I got it to work after looking at it again. Below are step by step instructions in case someone else looking for a similar solution comes across this post.
So I changed everything back to default in the file:
/usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy
Then I followed the instructions from the link:
https://wiki.archlinux.org/title/NetworkManager#Set_up_PolicyKit_permissions
Created a file:
sudo nano /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules
Changed the code in the link from:
polkit.addRule(function(action, subject) {
if (action.id.indexOf(“org.freedesktop.NetworkManager.”) == 0 && subject.isInGroup(“network”)) {
return polkit.Result.YES;
}
});
To:
polkit.addRule(function(action, subject) {
if (action.id.indexOf(“org.freedesktop.NetworkManager.”) == 0 && subject.isInGroup(“nmrestrict”)) {
return polkit.Result.NO;
}
});
Created a group called nmrestrict:
sudo groupadd nmrestrict
And added the user(s) to be restricted:
sudo usermod -aG nmrestrict username
I was able to achieve the same results as the previous method but in this case as you mentioned before it should not be overwritten with an update. Thanks again for the help. Learned a lot today.
Edit -
I tried to replicate this on another computer and it did not work. I realized it was because the spacing was off in the code so best to copy the code from the link and manually make the changes.