How to always run a script with privileges from an Electron App


There is specific action in the app that I am building that changes some system settings and thus always requires privileges. The action results in a command being executed in shelljs which changes network settings. Every time this command runs a password prompt is shown to the user to enter the password.

Is there a way in which this command can be run with privileges, once the user has entered the password?


I would think that the Electron app probably has to be run with privileges in the first place.