Copied to clipboard

Flag this post as spam?

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


  • Ben Liyanage 11 posts 32 karma points
    Sep 02, 2010 @ 17:46
    Ben Liyanage
    0

    How do you throw an access denied exception so that it gets handled by Umbraco?

    Hey,

    I have some user controls that under certain circumstances should not be accessible to some users.  I would like to pitch the user to the standard umbraco access denied page that I have set up in the backend.

    How do I go about doing this?

    Thanks for any advice.

  • Sascha Wolter 615 posts 1101 karma points
    Sep 09, 2010 @ 23:57
    Sascha Wolter
    0

    Hi Ben,

    hope this is still relevant. I would suggest you create a new user control and add it to the master page of your site. Check in that usercontrol if the user has permissions to access the page, if not redirect him manually to the login page. If that doesn't work for you since it is the usercontrol itself that decides if access is allowed and not on a page level then you could e.g. add the authorization usercontrol to each one of the usercontrols which need it. If the viewed page doesn't have any restricted uc's on it there will be no check, if there is more than one the check will be done more than once (which I guess you can live with).

    Hope that helps,

    Sascha

Please Sign in or register to post replies

Write your reply to:

Draft