mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fix issue where unable to access files in App_data (#8180)
This commit is contained in:
@@ -141,6 +141,12 @@ namespace Orchard.FileSystems.AppData {
|
|||||||
// move to destination
|
// move to destination
|
||||||
// will throw exception if destination exists
|
// will throw exception if destination exists
|
||||||
File.Move(tempPath, path);
|
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) {
|
public Stream CreateFile(string path) {
|
||||||
@@ -219,4 +225,4 @@ namespace Orchard.FileSystems.AppData {
|
|||||||
return CombineToPhysicalPath(path);
|
return CombineToPhysicalPath(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user