Ask user for permissions

Answered

One of my plugin's actions involves copying files into some arbitrary user specified directory. In this case, it would be useful if the plugin could ask the user for elevated permissions in order to copy into certain directories. Basically, on a Windows machine, I would like if the plugin is able to trigger that message box that says "IntelliJ is asking for admin permissions" or similar. It would be inconvenient if the user had to run the entire IDE as admin just to use the plugin. I was looking at the Java Permission classes but could not figure out how to request permissions from the user using them (is it even possible?). It would be best if solutions exist for Linux and Mac too.

 

1 comment
Comment actions Permalink

IntelliJ IDEA uses the special native .exe launcher for that.

See https://github.com/JetBrains/intellij-community/tree/master/native/WinElevator for the details.

0

Please sign in to leave a comment.