Home All Groups Group Topic Archive Search About

GetAccess Control for Directory

Author
10 Aug 2006 10:27 PM
mgonzales3
I need to find out if i can write to a directory.  There is a p/invoke method
called AuthzAccessCheck. 

I have only found examples of the AccessControl namespace retrieving
file.GetAccessControl instead of Directory.GetAccessControl.

any ideas?

thanks

Author
11 Aug 2006 2:13 PM
Joe Kaplan (MVP - ADSI)
The AccessCheck and AuthZAccessCheck functions are designed to interpret the
security descriptor of the resource in question and compare that to the
security token (or AuthZ context) of the user to determine whether they will
be allowed access.  It is the right way to go in your scenario.

Just reading the security descriptor (via the AccessControl namespace) may
be helpful for some things, but it can be quite difficult to interpret it
directly.  Users can be members of many groups and built-in SIDs, and ACLs
can contain allows and denies that must be considered in a specific way.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"mgonzales3" <mgonzal***@discussions.microsoft.com> wrote in message
news:3162C82C-49D1-45BC-B469-4275AAFE97E8@microsoft.com...
>I need to find out if i can write to a directory.  There is a p/invoke
>method
> called AuthzAccessCheck.
>
> I have only found examples of the AccessControl namespace retrieving
> file.GetAccessControl instead of Directory.GetAccessControl.
>
> any ideas?
>
> thanks