Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bo Jacobsen 590 posts 2366 karma points
    Oct 18, 2017 @ 07:39
    Bo Jacobsen
    0

    Allow all backend users to se all protected frontend pages

    Using Umbraco Version 7.5.11

    Hey everyone.

    If you are logged into umbraco, i want the user to be able to see all protected frontend pages. Is that possible?

    I found like threads like this and this one

    But they are 4 and 5 year old posts. So maybe there is a new smarter way?

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Oct 18, 2017 @ 08:56
    Dan Diplo
    0

    Presumably your front-end is protected by standard Umbraco membership? In that case I'd approach it by creating a dummy Member (say "Back End User") that has permission to access all protected pages. A simple way would be then to give the back-end users the login details of this account. No coding needed :)

    But if you really wanted it to be automatic, then you'd have to add some extra logic. Something like:

    • In a master page / controller that runs on every request check if a back-end user is logged-in
    • Then check if the Back End User member is already logged in (if so, no need to do anything)
    • If not, then log the back-end user in programmatically (use membership service and forms authentication)

    They should then have access to member pages. I think you are going to need a dummy member otherwise any calls to access member properties won't break, even if you get around authentication.

  • Bo Jacobsen 590 posts 2366 karma points
    Oct 18, 2017 @ 12:40
    Bo Jacobsen
    0

    Hey Dan.

    Thank you for answering.

    I would like to do it without a dummy member.

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Oct 18, 2017 @ 14:47
    Dan Diplo
    0

    Then a lot of work awaits you, I fear. You'll probably need to write a custom membership provider and quite possibly have to modify the Umbraco core.

    For instance, what if you have some code like this:

    if (Members.IsLoggedIn())
    {
       var member = Members.GetCurrentMember();
       <p>Hello @member.Name<p>
    }
    

    So if you fake the member being logged in then you will pass the Members.IsLogged() in check but then your code will blow up as there won't actually be a current member to access.

  • Bo Jacobsen 590 posts 2366 karma points
    Jan 22, 2018 @ 15:29
    Bo Jacobsen
    0

    Hey Dan.

    Thats true. I will return when i decide what to do :)

Please Sign in or register to post replies

Write your reply to:

Draft