Link to home
Start Free TrialLog in
Avatar of YZlat
YZlatFlag for United States of America

asked on

General File Security question

How can I change the security settings of a file while preserving the
existing inherited access rules and also preventing the access rules from inheriting changes
in the future?
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Right-click the file and select properties.
Select the security tab and click the advanced button.
Uncheck 'Allow inheritable permissions from the parent to propagate to this object and all child objects. Include these entries explicitly defined here' checkbox
On the prompt click copy.
Now add any other permissions you want.
Click ok.
Click ok.
Job done
Avatar of YZlat

ASKER

LOL I mean programmatically, using C#. That's why i posted my question in programming zonefor C#
You can do this with the filesecurity class using the addaccessrule method.

http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.filesecurity.aspx
Avatar of YZlat

ASKER

jacko72, I know I can use this class, but how exactly can I accomplish changing the security settings of a file while preserving the existing inherited access rules and also preventing the access rules from inheriting changes
in the future?
ASKER CERTIFIED SOLUTION
Avatar of YZlat
YZlat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of YZlat

ASKER

Found the answer I was looking for on my own