Search code examples
wcfvisual-studio-2010permissionspublish

Publish website and set folder permissions


first, a little background. I am using VS2010 and have a WCF service that we publish through VS2010. I added a new folder to the service to include some android APKs (did some setup to get those pushed also through the publish routine). We have a method that will read the apks, and another that will execute a command (in the same folder) to extract the version information. Also, we use impersonation in our service.

The problem we are having right now is if a user that doesn't have r/w access to this folder makes a call to our method it will exception because of permissions to the folder. (Setting permissions on the folder manually fixes the issue, but when we publish again the folder may get deleted and recreated.)

Question(s): How do I setup the publisher to set folder permissions when it is publishing?


Solution

  • I found a few sites that described the exact answer I was looking for, but I was unable to get them to work and I didn't know how to debug them. I ended up doing this in a msbuild script that we have using a command called "Cacls"

    So, it is possible I believe, but I wasn't able to achieve it.