Check Permissions to access a folder

Discussion in 'ASP .Net Security' started by krammai, Apr 6, 2006.

  1. krammai

    krammai Guest

    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.
     
    krammai, Apr 6, 2006
    #1
    1. Advertising

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

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

    > Article at following url will help you. It has code as well as
    > description about what you want to achieve.
    > http://msdn2.microsoft.com/en-us/library/ms229078.aspx
    >
    > "krammai" <> wrote in message
    > news:...
    >
    >> 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.
     
    Dominick Baier [DevelopMentor], Apr 7, 2006
    #2
    1. Advertising

  3. krammai

    Atul Guest

    Article at following url will help you. It has code as well as description
    about what you want to achieve.
    http://msdn2.microsoft.com/en-us/library/ms229078.aspx


    "krammai" <> wrote in message
    news:...
    > 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.
     
    Atul, Apr 7, 2006
    #3
  4. krammai

    MikeS Guest

    >>ASP.NET 2.0
    >>microsoft.public.dotnet.framework.aspnet.security


    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
     
    MikeS, Apr 7, 2006
    #4
    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. Dante
    Replies:
    0
    Views:
    355
    Dante
    May 11, 2004
  2. Jason
    Replies:
    0
    Views:
    442
    Jason
    May 13, 2004
  3. Scott Allen
    Replies:
    0
    Views:
    440
    Scott Allen
    Jul 13, 2004
  4. ralderton

    Folder Permissions

    ralderton, Aug 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    10,449
    Jeffrey Tan[MSFT]
    Aug 7, 2004
  5. Curt K
    Replies:
    0
    Views:
    566
    Curt K
    Nov 3, 2006
Loading...

Share This Page