从分层对象存储读取/写入到分层对象存储 - SharePoint 2007

发布于 2024-10-09 16:52:44 字数 270 浏览 0 评论 0原文

我创建了一个自定义计时器作业,需要一些配置才能运行。我正在尝试将配置保存为分层对象存储中的 SPPersistedObject

分层对象存储保存在 SharePoint 配置数据库中,因此我在尝试使用 SPWebApplication 作为父级保存它时收到“安全错误”。

我什至尝试过提升权限,但它没有帮助,因为它只是当前 Web 应用程序的应用程序池帐户,它不需要访问 SharePoint 配置数据库。

有什么想法吗?

I've created a custom timer job which has requires some configurations to run. I'm trying to save the configurations as an SPPersistedObject in hierarchical object store.

Hierarchical object store is saved in the SharePoint configuration database and hence I'm getting 'Security Error' while trying to save it with a SPWebApplication as the parent.

I've even tried elevating the privileges but it dint help because it is just the application pool account for the current web application and it is not necessary for it to have the access to the SharePoint config database.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泪痕残 2024-10-16 16:52:44

正如您所发现的,分层对象存储 (HOS) 存储在配置数据库中,而不是内容数据库中。

如果您在中央管理之外的站点上下文中运行,则应用程序池使用的用户帐户 可能没有写入配置数据库的权限

这有点奇怪,因为您可能不会在开发人员安装中看到这一点(因为您可能不会使用应用程序池的域级别帐户进行设置,只有网络服务),并且只有当您获得到生产。

注意 - 使用 SPSecurity.RunWithElevatedPrivileges 不会更改此设置,因为它只是从受限用户帐户提升到应用程序池帐户,而不是中央管理应用程序池帐户。

文章 管理应用程序状态 提供了选项的详细信息,并介绍了 HOS

安全模型-用户需要
管理员权限来访问
相关的 SharePoint 对象(例如
SParm 或 SPWebApplication)。

由于这些原因我认为居屋在现实世界中的使用非常有限,你最好使用属性包存储模型,它可以存储农场/网络应用程序/站点和列表级别的设置:-

优点 - 这可能是最大的
重量轻且易于使用
配置存储选项。

据报道,还有性能和稳定性方面的优势

事实上,MSDN SharePoint 指导库也使用属性包存储来存储分层配置管理器的实现。

As you've found the hierarchical object store (HOS) is stored in the configuration database, not the content database.

If you're running in the context of a site other than the central admin then the user account the application pool uses may not have permissions to Write to the configuration database.

This is a bit of a doozy as you probably won't see this on a developer installation (as you probably won't have it setup with domain level accounts for app pools, only NETWORK SERVICE) and you will only trip up when you get to production.

Note - Using SPSecurity.RunWithElevatedPrivileges will not change this as that just eleveates from the restricted user account to the application pool account and not the central admin app pool account.

The article Managing Application State gives a breakdown of the options and it says about the HOS

Security model - Users need
administrator privileges to access the
related SharePoint object (such as
SPFarm or SPWebApplication).

For these reasons I think the HOS is very limited in real world usage and you're better off using the Property Bag Storage model which can store settings at the Farm/WebApp/Site and List Levels :-

Advantages - It is probably the most
light-weight and easy to use of all
the configuration storage options.

There are also reported performance and stability benefits.

In fact the MSDN SharePoint Guidance Library also uses the Property Bag storage for their implementation of a hierarchical Configuration Manager.

べ映画 2024-10-16 16:52:44

请关注下面的文章,也许对您有帮助
http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=271

以及 codeplex 上的项目

http://features.codeplex.com/

Kindly follow the below article that may be help for you
http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=271

as well a project on codeplex

http://features.codeplex.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文