I need a bit of advice on setting permissions on a created directory, i am new to c# and have searched the net but i am really one the wiser, basically i call the following method after the userFolder is created:
The permissions that i want to have on the userFolder is List Folder Contents and Read, i can get the first one with the above code but dont know how to set the Read permission.
I need to have two permission entries for the user that the folder is assigned to which are ReadAndExecute and Read.
Any advice will be greatly appreciated!
private void FolderPermissions(string rootDir, string userFolder)
DirectoryInfo dinfo = new DirectoryInfo(rootDir + userFolder);
DirectorySecurity dSecurity = dinfo.GetAccessControl();
FileSystemAccessRule rule = new FileSystemAccessRule(userName, FileSystemRights.ReadAndExecute,
InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow);