+1-888-365-2779
Try Now
More in this section

Forums / 3.x Pre-release forums (retired) / Navigation according to Roles

Navigation according to Roles

2 posts, 0 answered
  1. vijay
    vijay avatar
    3 posts
    Registered:
    21 May 2008
    29 May 2009
    Link to this post
    I would like to implement functionality that allows us to designate, on a per page basis, where the user should be redirected to if they don't have permissions to the page.  We should be able to select the page to redirect to (we call it the "alternate page") within the admin section of the system.
     
    How is best to implement this functionality?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    29 May 2009
    Link to this post
    Hi vijay,

    The current implementation does not support changing the page properties, although there are several hacks
    However, I would like to suggest the easiest way for your requirement.

    1. Create a user control and add the following logic on Page_Load()

       protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!Page.IsPostBack && !Page.User.Identity.IsAuthenticated) 
            { 
     
                CmsManager manager = new CmsManager(); 
                CmsSiteMapNode node = SiteMap.CurrentNode as CmsSiteMapNode; 
                if (node != null && node.Title.Equals("redirect")) 
                { 
                    Response.Redirect("http://www.telerik.com"); 
                } 
     
            }  
        } 

    By doing so, you are checking whether the user that access the page has been authenticated. If not and the page name is "redirect" it will be sent to your custom login page using Response.Redirect Method.
    You can modify the code and create a collection of pages that will have custom login pages.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered