Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): 3.x Pre-release forums (retired) > Navigation according to Roles

Navigation according to Roles

  • vijay avatar

    Posted on May 29, 2009 (permalink)

    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?

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on May 29, 2009 (permalink)

    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.

    Reply

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): 3.x Pre-release forums (retired) > Navigation according to Roles