Home All Groups Group Topic Archive Search About

Directory access check

Author
17 Jan 2006 11:34 AM
Birger Niss
Hi,

I need to check the current principal's read-, write- and full control
access to a given directory without using try-catch.

Any suggestions will be highly appreciated.

Best regards
Birger Niss

Author
17 Jan 2006 11:51 AM
Dominick Baier [DevelopMentor]
Hi,

in .NET 2.0 this functionality is wrapped in the System.Security.AccessControl
namespace. In 1.1 there are wrappers out there. Never tried them, though.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Show quoteHide quote
> Hi,
>
> I need to check the current principal's read-, write- and full control
> access to a given directory without using try-catch.
>
> Any suggestions will be highly appreciated.
>
> Best regards
> Birger Niss
Author
17 Jan 2006 12:02 PM
Birger Niss
Hi Dominick,

With System.Security.AccessControl I may get hold of all the access rules
pertaining to a directory. I can then traverse all of these (users and
groups) to figure out which rules applies to "me".
One problem - however - is that without proper access rights I cannot get
hold of the access rules, so this will raise an exception and I'm back at
square one.

Best regards
Birger



Show quoteHide quote
"Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
wrote in message news:4580be631951d58c7e97bd9653a62@news.microsoft.com...
> Hi,
> in .NET 2.0 this functionality is wrapped in the
> System.Security.AccessControl namespace. In 1.1 there are wrappers out
> there. Never tried them, though.
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
>> Hi,
>>
>> I need to check the current principal's read-, write- and full control
>> access to a given directory without using try-catch.
>>
>> Any suggestions will be highly appreciated.
>>
>> Best regards
>> Birger Niss
>
>
Author
17 Jan 2006 12:12 PM
Dominick Baier [DevelopMentor]
Hi,

makes sense :)

in a similar thread Joe suggested to use the Win32 AuthZAccessCheck function.

I have no clue if this is the right approach - but i would love to hear from
someone who has successfully used that API :)

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Show quoteHide quote
> Hi Dominick,
>
> With System.Security.AccessControl I may get hold of all the access
> rules
> pertaining to a directory. I can then traverse all of these (users and
> groups) to figure out which rules applies to "me".
> One problem - however - is that without proper access rights I cannot
> get
> hold of the access rules, so this will raise an exception and I'm back
> at
> square one.
> Best regards
> Birger
> "Dominick Baier [DevelopMentor]"
> <dbaier@pleasepleasenospamdevelop.com> wrote in message
> news:4580be631951d58c7e97bd9653a62@news.microsoft.com...
>
>> Hi,
>> in .NET 2.0 this functionality is wrapped in the
>> System.Security.AccessControl namespace. In 1.1 there are wrappers
>> out
>> there. Never tried them, though.
>> ---------------------------------------
>> Dominick Baier - DevelopMentor
>> http://www.leastprivilege.com
>>> Hi,
>>>
>>> I need to check the current principal's read-, write- and full
>>> control access to a given directory without using try-catch.
>>>
>>> Any suggestions will be highly appreciated.
>>>
>>> Best regards
>>> Birger Niss