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 8159921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:04:44+00:00 2026-06-06T18:04:44+00:00

I have a requirement to implement user privilege elevation in an MVC3 web app,

  • 0

I have a requirement to implement user privilege elevation in an MVC3 web app, for both Forms and Windows authentication, but this question is critical for Windows auth. This is for a higher privileged user to give assistance to a lower privileged user, e.g. when a clerical user is performing a task and requires an admin user to do a task before the clerical user can continue, the admin user should be able to elevate the same session to their privilege level, perform the admin task, and restore the lower privilege to the session. I don’t see a way here without the clerical user logging off and the admin user logging on, given that we want to achieve this on the desktop of the clerical user alone. Maybe user switching is tidier than a whole new session, but I would very much like a “run as” equivalent for Windows authenticated web apps.

Is this even possible, and if so, how can I achieve this? I have no idea where to even begin looking.

  • 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-06T18:04:45+00:00Added an answer on June 6, 2026 at 6:04 pm

    You could put an anchor somewhere on your site:

    @Html.ActionLink("elevate to admin", "SwitchToAdmin", "Home")
    

    and then have a controller action which will allow for inputting the administrator credentials:

    public ActionResult SwitchToAdmin()
    {
        // TODO: Adjust the role name that your administrators will have
        if (!User.IsInRole(@"DOMAIN\Administrators"))
        {
            // The user is not currently an admin => popup a Logon box
            // so that the administrator could authenticate himself
            return new HttpUnauthorizedResult();
        }
        else
        {
            // After inputting the correct username and password for the
            // admin, we can now redirect to the home action and start performing
            // the admin tasks
            return RedirectToAction("index", "home");
        }
    }
    

    The revert process will be the inverse. You could have a link which will call a controller action that will throw 401 if the user is an admin allowing for the normal user to enter his username and password.

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

Sidebar

Related Questions

I have a requirement to implement contact database. This contact database is special in
I have a requirement which sounds like kind of simple but hard to implement
I have a requirement for an ASP.NET web application whereby the same user is
I've got a requirement which I have to implement autocomplete, but I'm not sure
I have a requirement where I need to implement a thumbs up, thumbs down
I have requirement to disable copy/paste/cut operations on a textbox. For this purpose I
I have requirement of specifying web part connections in onet.xml. So when site is
I have a requirement to implement some kind of dictionary object. Something like MyDict<K,V1,
We have a web application (JQuery and Spring) running on weblogic app server. There
I have a requirement where i need to generate html forms on the fly

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.