473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Switching inheritance on and off for File system permissions

Hi Everyone
When a folder is created its file system
permissions are inherited automatically to its subfolders and its subfiles.
I want to switch the inheritance on and off through c# code. Following is
the small snippet of the code that I have written to do this. But it is not
working properly

ActiveDs.IADsAccessControlList obDacl = ( ActiveDs.IADsAccessControlList )

securitydescriptor.DiscretionaryAcl;

Allow = new AccessControlEntryClass();

//For recursive security settings

Allow.AceFlags = (int)ADS_ACEFLAG_ENUM.ADS_ACEFLAG_NO_PROPAGATE_INH ERIT_ACE;

//ACE is allow type

Allow.AceType = 3;

Can anyone please help me?


Nov 15 '05 #1
1 1706
Not sure what exactly you mean with:
But it is not
working properly
but I guess this is what you need to use....

Allow.AceFlags = (int)ADS_ACEFLAG_ENUM.ADS_ACEFLAG_INHERITED_ACE;

Willy.
"Captain Kirk" <go***********@yahoo.com> wrote in message
news:O9**************@tk2msftngp13.phx.gbl... Hi Everyone
When a folder is created its file system
permissions are inherited automatically to its subfolders and its subfiles. I want to switch the inheritance on and off through c# code. Following is
the small snippet of the code that I have written to do this. But it is not working properly

ActiveDs.IADsAccessControlList obDacl = ( ActiveDs.IADsAccessControlList )

securitydescriptor.DiscretionaryAcl;

Allow = new AccessControlEntryClass();

//For recursive security settings

Allow.AceFlags = (int)ADS_ACEFLAG_ENUM.ADS_ACEFLAG_NO_PROPAGATE_INH ERIT_ACE;
//ACE is allow type

Allow.AceType = 3;

Can anyone please help me?



Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hal Vaughan | last post by:
I've been reading up on file permissions (including FilePermission, Permission, and Permissions). From what I see, these are temporary and forgotten when a program exits (if I'm wrong, tell me,...
1
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String...
0
by: Jeff | last post by:
I am trying to write some C# code that will allow me to determine if the current user running my application has "write" permissions to a particular folder. However, I can't seem to get it to...
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
2
by: Vinayak Raghuvamshi | last post by:
I have a file that has been created using shared read/write access. But C# code never is able to open this file for read and keeps throwing "...cannot open file as it is being used by another...
1
by: TeeCo | last post by:
Hi folks. I'm trying to change the location of the Access mdb file I connect to using OleDb and am having trouble. I'm using Visual C# 2005 and the default values I use for the ConnectionString...
7
by: sprash | last post by:
Newbie question: I'm trying to determine if a file physically exists regardless of the permissions on it Using File.Exists() returns false if it physically exists but the process does not...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
8
by: Scott M. | last post by:
What am I doing wrong? If I simply create a new ASP .NET Web Application Project (WAP) on my local file system and then go into the project properties and switch the web server over to IIS and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.