Forum Discussion
Devendra Singh
Jan 18, 2017Copper Contributor
SharePoint 2013 custom access denied page
We have a requriement wherein users who don't have access to our custom SP2013 site should get to see a custom access denied page instead of the default access denied page. Basically as part of this ...
Devendra Singh
Jan 18, 2017Copper Contributor
I was wondering if there was any better or alternative approach the HTTPModule approach is quite dated and requires deployment in the server farm . Also, we did NOT want to have a solution for the entire farm, instead just of our site collection or at the max for the web application containing the site collection.
Jan 18, 2017
I know HTTPModule technique is quite dated and covered around the Internet...but think about your requirement: you want to check, no matter the page the user is trying to access, if he can acccess to the site or not...so I don't see how are you going to achive this using client side coding...another alternative to the HTTPModule is a custom hidden control you add to the master page of the site so enabling/disabling the specific feature will add this functionality to your sites or not
- Devendra SinghJan 25, 2017Copper Contributor
I would rather try the following option, looks to be meeting my current requirement.
https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.administration.spwebapplication.updatemappedpage.aspx
https://blogs.msdn.microsoft.com/fabdulwahab/2012/10/02/how-to-customize-error-page-page-not-found-and-access-denied-in-sharepoint-2010/
Will updated here with the results...
- Devendra SinghJan 25, 2017Copper Contributori.e. using SPWebApplication.UpdateMappedPage method
- Jan 25, 2017Much better approach...I didn't remember this solution...I'm getting old :-(. The only downside here is that it still requires to deploy stuff in the server side.