我目前正在尝试拦截 SharePoint 发送的请求,以便使用 HttpModule 查看文档库中的文档以进行自定义处理。
不幸的是,SharePoint 似乎通过 ActiveX 控件 (OpenDocuments) 发送请求,而 HttpModule 看不到这些请求。
我在这里要做的是:1-拦截请求2-验证当前用户是否有权打开文档(自定义权限级别)。3- 如果用户没有权限,将请求转移到拒绝访问页面。
我的问题是:有没有办法做到这一点(有或没有httpmodule)?
当前代码供参考:
public class ViewOnlyModule : IHttpModule
{
HttpApplication App;
public void Init(HttpApplication context)
{
App=context;
context.BeginRequest += new EventHandler(PreventAccessToFile);
//context.PreRequestHandlerExecute += new EventHandler(PreventAccessToFile);
}
public void Dispose()
{
}
private void PreventAccessToFile(Object sender, EventArgs e)
{
//Code
}
}