Getting file permissions

Discussion in 'ASP .Net' started by kratc, Jul 23, 2007.

  1. kratc

    kratc Guest

    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..
    kratc, Jul 23, 2007
    #1
    1. Advertising

  2. "kratc" wrote in message news:...

    > 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...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
    Mark Rae [MVP], Jul 23, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Allen
    Replies:
    0
    Views:
    426
    Scott Allen
    Jul 13, 2004
  2. Florian Lindner

    Getting other file permissions

    Florian Lindner, Aug 30, 2004, in forum: Python
    Replies:
    2
    Views:
    329
    Richard Townsend
    Aug 30, 2004
  3. Pranav Bagora
    Replies:
    2
    Views:
    360
    Peter Hansen
    Jul 22, 2005
  4. Hari

    Getting File Permissions

    Hari, Mar 7, 2006, in forum: Python
    Replies:
    3
    Views:
    386
    Tim Chase
    Mar 7, 2006
  5. Curt K
    Replies:
    0
    Views:
    554
    Curt K
    Nov 3, 2006
Loading...

Share This Page