public static void SetAccessControl(this DirectoryInfo directoryInfo, DirectorySecurity directorySecurity)
        {
            if (directorySecurity == null)
                throw new ArgumentNullException(nameof(directorySecurity));
            Contract.EndContractBlock();

            String fullPath = Path.GetFullPath(directoryInfo.FullName);
            directorySecurity.Persist(fullPath);
        }
Example #2
0
        [System.Security.SecuritySafeCritical]  // auto-generated
        public static void SetAccessControl(String path, DirectorySecurity directorySecurity)
        {
            if (directorySecurity == null)
                throw new ArgumentNullException("directorySecurity");
            Contract.EndContractBlock();

            String fullPath = Path.GetFullPathInternal(path);
            directorySecurity.Persist(fullPath);
        }
 public static void SetAccessControl(string path, DirectorySecurity directorySecurity)
 {
     if (directorySecurity == null)
     {
         throw new ArgumentNullException("directorySecurity");
     }
     string fullPathInternal = Path.GetFullPathInternal(path);
     directorySecurity.Persist(fullPathInternal);
 }