Check Permissions to access a folder

K

krammai

Does ASP.NET 2.0 provide an easy way to programatically determine if a user
has permissions to access a particular folder? If yes, code snippets would be
greatly appreciated.
 
D

Dominick Baier [DevelopMentor]

Hi,

well - it is not as easy.

You can get to the information who has which access on a file - but this
won't necessarily help you, e.g.

you will see the groups/folders - if a user is not individually added to
the ACL list - you would still have to figure out his group memberships.
There is no easy way of doing that (besides for a user you have a token for,
which allows to check his group memberships)
 
M

MikeS

ASP.NET 2.0
This seems to work.

Private Function HasAccess(ByVal Path As String) As Boolean
With New SiteMapNode(SiteMap.Provider, Guid.NewGuid.ToString,
Path)
Return .IsAccessibleToUser(Context)
End With
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top