|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Security settings for FolderI am using below code to give access to a user but when I check in explorer only "Special Permission' is checked instead of "FullControl"? DirectoryInfo di = Directory.CreateDirectory("C:\\zDeleteMe"); DirectorySecurity dSecurity = di.GetAccessControl(); // Add the FileSystemAccessRule to the security settings. dSecurity.AddAccessRule(new FileSystemAccessRule("MyDomain\\Myuser", FileSystemRights.FullControl, AccessControlType.Allow)); // Set the new access settings. di.SetAccessControl(dSecurity); Thanks, You need to specify the inheritance options when creating the access rule.
e.g.: dSecurity.AddAccessRule(new FileSystemAccessRule("MyDomain\\Myuser", FileSystemRights.FullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow)); Show quoteHide quote "Tinu" <dhir***@icode.com> wrote in message news:OvmfoK%23kGHA.4660@TK2MSFTNGP05.phx.gbl... > Hi, > > I am using below code to give access to a user but when I check in > explorer only "Special Permission' is checked instead of "FullControl"? > > > > > DirectoryInfo di = Directory.CreateDirectory("C:\\zDeleteMe"); > > DirectorySecurity dSecurity = di.GetAccessControl(); > > // Add the FileSystemAccessRule to the security settings. > > dSecurity.AddAccessRule(new FileSystemAccessRule("MyDomain\\Myuser", > > FileSystemRights.FullControl, AccessControlType.Allow)); > > // Set the new access settings. > > di.SetAccessControl(dSecurity); > > > Thanks, > > > > >
Import SIMPLEBLOB session key into .NET?
[assembly: SecurityPermission] question Trust relationship exception Bad Data with DES Decryption https and httplistener Microsoft CryptoAPI CSP Availability SignedXml, X509Certificate2 and certificates with *Strong* protection Strange behavior or where is SecurityException? Mapping AZMAN to our existing security Design, Scenario? windows authentication with custom role |
|||||||||||||||||||||||