Do you have an easy way to set only R,W,M,D,RE permissions?

Got a problem you cannot solve? Try here.
Post Reply
dunion
Posts: 106
Joined: Tue Oct 14, 2008 10:43 am

Do you have an easy way to set only R,W,M,D,RE permissions?

Post by dunion »

If I set Read/Write it sets 'Full' which we don't want.
I'm using Set Read Write Permissions on File System Object "..." for "..."

I don't want to install and call xacls, obviously I could write it in code and run some custom code but I was thinking this was a common enough operation there may be some built in function for it.
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Do you have an easy way to set only R,W,M,D,RE permissio

Post by mills »

Take a look at the Access Control section under Design/Advanced Options:
Access_Control.jpg
Access_Control.jpg (205.26 KiB) Viewed 4045 times
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
dunion
Posts: 106
Joined: Tue Oct 14, 2008 10:43 am

Re: Do you have an easy way to set only R,W,M,D,RE permissio

Post by dunion »

That's where I started but the options are read, write or full and putting read, write (but not full) still end up with full.
What I need is explicitly 'everyting but Full and Special'
What I tried is to run a bit of code to do the following

DirectoryInfo di = new DirectoryInfo(path);
DirectorySecurity ds = di.GetAccessControl();
Then I remove inherited permissions and set permissions via.
ds.AddAccessRule(new FileSystemAccessRule(...)) - add explicit permissions.
di.SetAccessControl(ds);
And a few variants

This works on Vista - the problem on a clean Win7 system in the ProgramData area (where I need to grant rights) the user doesn't have ownership, so the GetAccessControl() fails unless I take ownership in code, which I don't necessarily want to do....
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Do you have an easy way to set only R,W,M,D,RE permissio

Post by mills »

IA doesn't have permission capabilities beyond what I previously mentioned. I did find a link that might have some code samples that might help you:
http://www.debugging.com/bug/1522

This link really caught my attention:
http://www.codeproject.com/dotnet/NTSecurityNET.asp
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Post Reply