None of this is suitable for window events, as they will run multiple times depending on caching. Use just a Client Startup event that calls a function in the project library. Use java's NetworkInterface class as shown in the topic linked in the OP to retrieve the correct outbound interface's mac address. Do not attempt to read any tag in the startup event. Just get the mac and make the gateway request to do the permissions lookup. Write the results to Vision Client Tag(s). In windows, bind to the Vision Client tags as needed.
The client startup event can conditionally open a desired main window, possibly with parameters, if that is needed in your application. (You would omit marking a main window that opens on startup in that case.)