Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8097693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:50:24+00:00 2026-06-05T21:50:24+00:00

This can be done by making a new HTTP handler, but is there a

  • 0

This can be done by making a new HTTP handler, but is there a simple way to configure the following?:

  1. Site is setup on basis of user accounts with username say A001, A002….etc.
  2. Once a user logs in they can access their resources in their directory (/A001) etc…which may contain files and images

The issue that I have had using roles and authorization in ASP.NET is that roles are either generic (defined by roles, example anyone logged in may be able to access the resource) or hard coded in the web.config files which is clearly not feasible in a dynamic environment where user accounts are being created:

<authorization>

<allow users="John"/> // allow John only 
<deny users="*"/>  // deny others

</authorization> 

Is there a simple way to ensure that only a certain user has access to their folder only?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:50:25+00:00Added an answer on June 5, 2026 at 9:50 pm

    Well using an HTTP Module would be simple enough.

    First this is the request life cycle:

    • Application_BeginRequest.
    • Application_AuthenticateRequest.
    • Application_PostAuthenticateRequest.
    • Application_DefaultAuthentication.
    • Application_AuthorizeRequest.
    • Application_PostAuthorizeRequest.
    • Application_ResolveRequestCache.
    • Application_PostResolveRequestCache.
    • Application_MapRequestHandler. Fired only when the server is running IIS 7 in Integrated Mode and at least >Net Framework 3.0
    • Application_PostMapRequestHandler.
    • Application_AcquireRequestState.
    • Application_PostAcquireRequestState.
    • Application_PreRequestHandlerExecute.
    • The page event handler is executed. (refer to the page life cycle)
    • Application_PostRequestHandlerExecute.
    • Application_ReleaseRequestState.
    • Application_PostReleaseRequestState
    • Application_UpdateRequestCache.
    • Application_PostUpdateRequestCache
    • Application_LogRequest. Fired only when server is IIS 7 Integrated Mode and at least .Net Framework 3.0
    • Application_PostLogRequest. Fired only when server is IIS 7 Integrated Mode and at least .Net Framework 3.0
    • Application_EndRequest.

    For more info: http://msdn.microsoft.com/en-us/library/system.web.httpapplication.aspx

    I think the best event that fits your needs is the Application_AuthorizeRequest

    Here you could get the path being accessed, and you could have a map in your database associating your uses with their allowed paths, something like:

    UserID         Path
    userID1        ~/UserFiles/User1
    userID2        ~/UserFiles/User2
    userID3        ~/UserFiles/User3
    

    Then in the event read this map and decide if the user should be authorized or not

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simple question. Just wondering if this can be done without me having to enforce
This can certainly be done using a simple script and reading the database. I
http://jsfiddle.net/JamesKyle/y7hBQ/ I'm making a simple jquery counting function that adds the following classes: First
I know this can be done and i have seen it done using some
I understand that this can be done at release using the maven-gpg-plugin. However, I
I am wondering if this can be done easily. I am doing some paypal
I know that this can be easily done by using if(i%5 == 0 OR
I'm basically work with Middleman 2 though if this can only be done in
Can this be done? It seems like this should be possible. In general, I
Can this be done in JavaScript? type == 1 ? function1() : function2();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.