title: Directory Security
body: <p>My app is creating a directory so that I can store log files in it. I'm adding user security to the directory, but I don't know how to make it propagate. For example, I'm adding the user <code>everyone</code> to the directory, with <code>read</code> and <code>write</code> access, but when my app then create a log file in this directory, the log file has not inherited the <code>everyone</code> security (read, write).</p>
  
  <p>What am I missing?</p>
  
  <pre><code>DirectorySecurity dirSec = Directory.GetAccessControl(_dbPath);
  dirSec.AddAccessRule(new FileSystemAccessRule("Everyone", FileSystemRights.Write, AccessControlType.Allow));
  dirSec.AddAccessRule(new FileSystemAccessRule("Everyone", FileSystemRights.ReadAndExecute, AccessControlType.Allow));
  dirSec.AddAccessRule(new FileSystemAccessRule("Everyone", FileSystemRights.CreateFiles, AccessControlType.Allow));
  Directory.SetAccessControl(_dbPath, dirSec);
  </code></pre>