TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
D A
NA
1
0
NTFS permissions set through System.Security.AccessControl don't take
Dec 11 2008 7:36 PM
I'm using System.Security.AccessControl library to add and delete NTFS permissions to files and folders (see code sample below).
public static void addPermissions(String path, String user) {
DirectoryInfo dInfo = new DirectoryInfo(path);
DirectorySecurity dSecurity = dInfo.GetAccessControl();
dSecurity.AddAccessRule(new FileSystemAccessRule(user,
FileSystemRights.FullControl,
InheritanceFlags.None,
PropagationFlags.None,
AccessControlType.Allow));
dInfo.SetAccessControl(dSecurity);
}
When checking properties' security tab of
path
in Windows Explorer,
user
is correctly added to the permissions list - but none of the individual permission boxes are checked - as if the
FileSystemRights
value was somehow "none" (which is not even a valid attribute).
Any thoughts on what I might be missing? Thank you.
Reply
Answers (
0
)
Save the RSA public key as a String in Digital Signatures
ASP.net & Windows Application Security