Getting file permissions

K

kratc

Hello.

I've been wondering for quite a while now if this even is without trying to open the file or something like that?

I'm trying to list all the files in a directory (with subdirectories) to which the logged in user has permissions. I'm using forms authentication and the permissions are specified in web.config files. Everything's fine as long as the listing of files goes, but I would only like to show the files to the user to which the user has permissions.

Does anyone know how to do this? Thanks alot..
 
M

Mark Rae [MVP]

I'm trying to list all the files in a directory (with subdirectories) to
which the logged in user has
permissions. I'm using forms authentication and the permissions are
specified in web.config files.
Everything's fine as long as the listing of files goes, but I would only
like to show the files to the
user to which the user has permissions.

Everything you need to do this can be found in the DirectoryServices
namespace...

Bear in mind, though, that the currently authenticated user isn't
necessarily the account that ASP.NET is running under (in fact, it almost
certainly isn't).

This article shows you how to set file permissions:
http://www.codeproject.com/dotnet/adduseracetofile.asp?df=100&forumid=15281&exp=0&select=821739
but the underlying process for checking permissions is virtually identical.

If you need any further assistance, I'd suggest you post in
microsoft.public.adsi.general, which is the newsgroup specifically for
ActiveDirectory matters. Make sure you tell them that you want to do this in
ASP.NET... Anything Joe Kaplan tells you can be considered as gospel...
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top