diff --git a/src/Orchard/FileSystems/AppData/AppDataFolder.cs b/src/Orchard/FileSystems/AppData/AppDataFolder.cs index 1c47b1119..bfb4dac67 100644 --- a/src/Orchard/FileSystems/AppData/AppDataFolder.cs +++ b/src/Orchard/FileSystems/AppData/AppDataFolder.cs @@ -141,6 +141,12 @@ namespace Orchard.FileSystems.AppData { // move to destination // will throw exception if destination exists File.Move(tempPath, path); + + // Modify file's access control to inherit permissions from parent directory. When files are moved they do not inherit + // permissions from the parent directory by default + System.Security.AccessControl.FileSecurity fileSecurity = File.GetAccessControl(path); + fileSecurity.SetAccessRuleProtection(false, false); + File.SetAccessControl(path, fileSecurity); } public Stream CreateFile(string path) { @@ -219,4 +225,4 @@ namespace Orchard.FileSystems.AppData { return CombineToPhysicalPath(path); } } -} \ No newline at end of file +}