Directory/File Permission Issue

I wrote code to set permission of the folder. Function I developed was

public void SetPermission(string user,FileSystemRights rights)
{
    DirectoryInfo dInfo = new DirectoryInfo(folderPath);
    DirectorySecurity oDirectorySecurity = new DirectorySecurity();

    oDirectorySecurity.AddAccessRule(new FileSystemAccessRule(user, rights, AccessControlType.Allow));
    dInfo.SetAccessControl(oDirectorySecurity);
}

This function is working fine to set permission for the user. But when I check folder Properties -> Security , user added. But no permission is checked in checkbox Open Advanced dialogbox. In this box I can see permission , which i set for the user.

So my question is Why there is no checkbox seleced on security tab, but it is there in advanced tab?

Please HELP me!!!!!!

Answers


I ran into this as well. It seems to be a Service Patch thing.

You can read how I fixed it at http://jspot.jerryhanel.com/2009/01/08/c-filedirectory-permissions/

The short version: You have to set a flag for all of the ACLs for all users. Yes... it's ugly. And when you add Service Pack 3, the checkmarks go away again. If anyone has a cleaner solution than this, PLEASE let me know.

I have code for that on my site.

UPDATE: The URL now points to the new site.


Need Your Help

Can i set up record types and arrays of record types PHP?

php

In pascal and delphi I am able to set up a custom type such as

Can Anyone Explain This Struts 2 AJAX Strange Refresh Behaviour?

ajax dojo struts2

We have the following code (listed below) in our JSP. We are seeing the action configured in the href of the div id=pwcercontainer being called twice. Can't work out exactly why. Replacing the cont...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.