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

Forums / Developing with Sitefinity / How can i check the access right to a ReturnURL (Querystring)

How can i check the access right to a ReturnURL (Querystring)

7 posts, 1 answered
  1. thomas3577
    thomas3577 avatar
    22 posts
    Registered:
    18 Feb 2007
    08 Sep 2009
    Link to this post
    Can i check the access right from a user for a ReturnURL?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    08 Sep 2009
    Link to this post
    Hello thomas3577,

    Could you elaborate some more about the desired behavior. I could not figure out what is the desired result.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. thomas3577
    thomas3577 avatar
    22 posts
    Registered:
    18 Feb 2007
    08 Sep 2009
    Link to this post
    Hm... i try it.

    I have three Roles. Admin, Author and Members.

    Situation:
    1. The User is not loggedin on my Sitefinity-website.
    2. The User click a Link on the Navigation (Sample: http://.../documents.aspx). This Page need access right from a Admin or a Author.
    3. For this reason, it is redirected to http://.../login.aspx?ReturnUrl=%2fdocuments.aspx
    4. The User logs in, but he is only a User with a Members-Role.
    5. About ReturnURL he comes back to documents.aspx, but he have no access right for this Page.
    6. It appears an error message.

    I want to avoid this error. The user should be redirected to another page.

    ....i have to lern english :-(
  4. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    08 Sep 2009
    Link to this post
    Hi thomas3577,

    Thanks for the more detailed explanation.

    In this case, you can use the <custom errors> element of the Web.config, sending the user to a specific user friendly error page. Sitefinity already has this implemented, however, you can change the redirect property to another page if you'd like:

    <customErrors mode="RemoteOnly"
                <error redirect="~/Sitefinity/nopermissions.aspx" statusCode="403"/> 
            </customErrors> 

    Kindly let us know if you have any questions.

    Sincerely yours,
    Joe
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  5. thomas3577
    thomas3577 avatar
    22 posts
    Registered:
    18 Feb 2007
    09 Sep 2009
    Link to this post
    Ok, Thanks... i have this code in the web.config. But the error message is different.

     

    Server Error in '/ClubNTB' Application.

    This type of page is not served.

    Description: The type of page you have requested is not served because it has been explicitly forbidden.  The extension '.aspx' may be incorrect.   Please review the URL below and make sure that it is spelled correctly.

    Requested URL: /documents.aspx


    Version Information: Microsoft .NET Framework Version:2.0.50727.4016; ASP.NET Version:2.0.50727.4016
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    09 Sep 2009
    Link to this post
    Hi thomas3577,

    If you are working on localhost, please set the customErrors mode to "<customErrors mode="On">"  When mode is set to On - the custom errors are shown to the remote clients and to the local host.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. thomas3577
    thomas3577 avatar
    22 posts
    Registered:
    18 Feb 2007
    09 Sep 2009
    Link to this post
    Oh.... sorry :-) Yes i work with localhost :-(

    Thanks!
Register for webinar
7 posts, 1 answered