PDA

View Full Version : File access and admin only privileges



TonyInSoMD
14th March 2018, 16:56
This isn't necessarily a Qt question, I'm just not sure where to ask this. I have a program. It needs to be able to read and write to a .csv file. I need to make it so that the user can't open the file with another program (like excel) unless they have admin privileges. Is there a way to do that? Something along the lines of the file requires admin privileges, the program has admin privileges, and the user doesn't have admin privileges.

d_stranz
14th March 2018, 18:00
Google for "Windows ACL". Using Access Control Lists might just turn out to be a hindrance, not a preventative. If a user has admin privileges, then you can't stop them from getting to a file. You can make it harder with ACL, making the file hidden, etc.

But remember, the program that creates, writes, and reads the file must have those permissions as well and that could be harder than keeping the user out. You have to be able to install the program and get it those rights, so that's going to require admin rights at a minimum.