I guess you must be familiar with what is HttpModule and how can we leverage it for our web applications. But if not, better have a good read of this article.
SharePoint is built on top of .NET, so it has all the rights to use the beauties of .NET.
Here I want to demo a simple case of httpmodule on SharePoint. Say if in a company it has lots of site collections and user 'Picky Docky' has access for all of them, for a reason farm administrator want to block him for one of the specific site without change his SharePoint permissions. Here are the steps to do it:-)
SharePoint is built on top of .NET, so it has all the rights to use the beauties of .NET.
Here I want to demo a simple case of httpmodule on SharePoint. Say if in a company it has lots of site collections and user 'Picky Docky' has access for all of them, for a reason farm administrator want to block him for one of the specific site without change his SharePoint permissions. Here are the steps to do it:-)
- Create a empty SharePoint solution
- add a class file to it named CustomSecurityModule.cs, code as below
- Create a feature and scope to "WebApplication"
- Create a feature receiver. Code as below
- When activate the feature it will create a modle in the web.config file for the SharePoint web applicaiton you deployed to as below:
This comment has been removed by the author.
ReplyDeleteI was trying to get rid of the error: "Could not load file or assembly 'RSSharePointSoapProxy" from my Site Collection.
ReplyDeleteThis article gave me a clue to get my SharePoint site back up and running after it got hosed when I was trying to install ReportingServices and ReportingServices Integration, and then uninstalled the Reporting Services Add-in for SharePoint Products. I am using SharePoint 2016 Enterprise Onsite (not Office 360) and SQL Server 2016 STD Ed. in a HyperV virtual machine.
This article does not directly address this problem, but it showed me what I should have already known or remembered that there are a bunch of ASP.NET configuration stuff in the web.config for the SharePoint VirtualDirectory in IIS that needed to be removed!
Search in this web.config file for "Report" and "ReportingServices" and "RSSharePoint" and remove (intellegently) the section in this web.config file for it and save it.
And then stop and restart the IIS and SharePoint Timer services after you are finished.* When I was done doing this in the correct web.config file I had to wait a little then the welcome logon screen popped up, and after a little bit of waiting my site collection was back up and running!
(When I had run the SQLServer 2016 STD Setup and uninstalled the Reporting Services Add-In, it appeared to work, but failed to take out these entries in the web.config.)