/// <summary>[AlphaFS] Check if the directory has permission inheritance enabled.</summary>
        /// <param name="path">The full path to the directory to check.</param>
        /// <returns><see langword="true"/> if permission inheritance is enabled, <see langword="false"/> if permission inheritance is disabled.</returns>
        public static bool HasInheritedPermissions(string path)
        {
            if (Utils.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentNullException("path");
            }

            DirectorySecurity acl = File.GetAccessControlInternal <DirectorySecurity>(true, path, AccessControlSections.Access | AccessControlSections.Group | AccessControlSections.Owner, PathFormat.RelativePath);

            return(acl.GetAccessRules(false, true, typeof(SecurityIdentifier)).Count > 0);
        }
 public DirectorySecurity GetAccessControl(AccessControlSections includeSections)
 {
     return(File.GetAccessControlInternal <DirectorySecurity>(true, LongFullName, includeSections, PathFormat.LongFullPath));
 }
 public DirectorySecurity GetAccessControl()
 {
     return(File.GetAccessControlInternal <DirectorySecurity>(true, LongFullName, AccessControlSections.Access | AccessControlSections.Group | AccessControlSections.Owner, PathFormat.LongFullPath));
 }
 public static DirectorySecurity GetAccessControl(string path, AccessControlSections includeSections, PathFormat pathFormat)
 {
     return(File.GetAccessControlInternal <DirectorySecurity>(true, path, includeSections, pathFormat));
 }
 public static DirectorySecurity GetAccessControl(string path, PathFormat pathFormat)
 {
     return(File.GetAccessControlInternal <DirectorySecurity>(true, path, AccessControlSections.Access | AccessControlSections.Group | AccessControlSections.Owner, pathFormat));
 }
예제 #6
0
 public FileSecurity GetAccessControl(AccessControlSections includeSections)
 {
     return(File.GetAccessControlInternal <FileSecurity>(false, LongFullName, includeSections, PathFormat.LongFullPath));
 }
예제 #7
0
 public FileSecurity GetAccessControl()
 {
     return(File.GetAccessControlInternal <FileSecurity>(false, LongFullName, AccessControlSections.Access | AccessControlSections.Group | AccessControlSections.Owner, PathFormat.LongFullPath));
 }