从 SharePoint 访问文件系统 - 访问被拒绝
我创建了一个自定义 SharePoint 应用程序,它扩展了 SharePoint 的一些 OOTB 功能。现在我想对应用程序进行许可并提供试用期等。因此,我想将许可信息存储在文件系统/注册表中,并检查整个应用程序中许可证的有效性。但即使在我提升到应用程序池身份之后(他只是域用户,而不是此处建议的系统管理员http://technet.microsoft.com/en-us/library/cc678863%28office.12%29.aspx) 我因访问我的文件而被拒绝。
从 SharePoint 应用程序在文件系统中读取/写入/创建文件的常见做法是什么?
I've created a custom SharePoint application which extends some of the OOTB functionality of SharePoint. Now I want to license the application and provide trial periods etc. So I want to store the licensing information in the file system/registry and check the validity of the license across the application. But even after I elevate to the application pool identity (who is just a domain user and not a system administrator as advised here http://technet.microsoft.com/en-us/library/cc678863%28office.12%29.aspx) I'm getting access denied for accessing my file.
What is the common practice to read/write/create files in the file system from SharePoint application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否检查过安全日志以查看哪个用户被拒绝访问。我非常确定登录到共享点的用户而不是尝试访问该文件的应用程序池身份。如果网站使用匿名身份验证,则应用程序池身份通常仅以这种方式使用。
Have you checked thet security logs to see which user is being denied access. I am pretty sure it will be the user who is logged into sharepoint rather than the app pool identity that is trying to access the file. The app poolidentity is usually only used in this way if the web site is using anonymous authentication.
您使用的是 SharePoint 2010 还是 2007?什么样的认证? NTLM,基于表格还是基于索赔?
如果应用程序在 NTLM 下运行,那么正如 Ben 建议的那样,应用程序将在 NTLM 帐户下运行,您应该能够访问该资源。
如果在表单下运行,应用程序将以匿名用户(本地帐户)身份运行,这将无法访问共享资源。
我建议使用 ProcMon,它将捕获底层访问被拒绝错误以及正在使用什么用户来访问该错误。
Are you using SharePoint 2010 or 2007? What kind of Authentication? NTLM, Forms or Claims based?
If application is running under NTLM, then as Ben suggested, application will run under NTLM account and you should be able to access the resource.
If running under forms the application will run as anonymous user (local account), which will fail to access the shared resource.
I would suggest using ProcMon, it will capture the underlying access denied error and what user is being used to access that.
我想除了将其存储在自定义数据库或配置为应用程序池帐户的完全访问权限的自定义文件夹中之外,没有其他解决方案。
I guess there is no other solution apart from storing it in a custom database or a custom folder which is configured with full access for the application pool account.