I have a windows desktop app (written in Delphi) that allows users to store and retrieve files.
Currently we have to allow every user of the app access to the shared folder, so a malicious user could find the directory and gain access to all of the files.
Is there a way that the app can act as a specific user such that only the "app as a user" and not each individual needs permission to the shared folder?
You need to either:
1) run the app as the desired user.
2) have your code programmably impersonate the desired user, via LogonUser()
and ImpersonateLoggedOnUser()
, or other similar functions, before then accessing the shared folder. Don't forget to stop impersonating when you are finished using the folder.