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.
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).
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.
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
is working on a reply...