title: C# - Set Directory Permissions for All Users in Windows 7
body: <p>This should be a fairly simple problem, but for some reason I can't seem to get this to work.  All I'd like to do is set the permissions on a given directory to allow full access to all users.  Here's the code I have so far:</p>
  
  <pre><code>System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(destinationDirectory);
  FileSystemAccessRule fsar = new FileSystemAccessRule("Users", FileSystemRights.FullControl, AccessControlType.Allow);
  DirectorySecurity ds = null;
  
      if (!di.Exists)
      {
         System.IO.Directory.CreateDirectory(destinationDirectory);
      }
  
  ds = di.GetAccessControl();
  ds.AddAccessRule(fsar);
  </code></pre>
  
  <p>No exceptions get thrown, but nothing happens, either.  When I check the directory permissions after the code has been run, I see no changes.</p>
  
  <p>Any ideas?</p>