Copied to clipboard

Flag this post as spam?

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


  • Nenad Kosanovic 18 posts 56 karma points
    Feb 28, 2014 @ 10:47
    Nenad Kosanovic
    0

    Custom route and membership authorization

    Dear all,

    I have implemented custom route :

                routes.MapRoute(
                    "User",
                    "User",
                    new { controller = "User", action = "Index" }
                );

    Now if URL www.domain.com/User comes in, it will be redirected to UserController, Index() method.

    And this is ok. My question is :

    What if I have Membe groups called "admin", "admin1". I wan't to restrict access to this url(page) dynamicly from Umbraco admin. To do this, I created dummy page that is called User, documentType is dummyDC.

    Then I add public acces restriction for member group admin.

    Problem is, that still users witouth this member group can acces the page.

     

    When dose Umbraco do this authorization?

     

    Approuch that is working is to use DocumentType "User" and Template "Index". Then to create document(page) called User with DC User and Template Index. But in that case, I have to work RenderModel in my controller and view or to extend that model or to pass CurrentTemplate(myModel); And also, I can't have nice and clean URL if I am using parameters like www.domain.com/user/id. It will look like www.domain.com/user?id=id.

    With rout definition I can create nice url, I don't need to work with RenderModel, but I dont have dynamic roles?

Please Sign in or register to post replies

Write your reply to:

Draft