从/向分层对象存储读取/写入 - SharePoint 2007 [英] Read/Write from/to Hierarchical Object Store - SharePoint 2007

查看:15
本文介绍了从/向分层对象存储读取/写入 - SharePoint 2007的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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.

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

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.

有什么想法吗?

推荐答案

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

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.

注意 - 使用 SPSecurity.RunWithElevatedPrivileges 不会改变这一点,因为它只会从受限用户帐户提升到应用程序池帐户,而不是中央管理应用程序池帐户.

文章管理应用程序状态 提供了选项的细分和它说的是居屋

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

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

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

出于这些原因我认为 HOS 在现实世界中的使用非常有限,您最好使用 Property Bag Storage 模型,它可以在 Farm/WebApp/Site 和 List 级别存储设置:-

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.

还报告了性能和稳定性优势.

实际上 MSDN SharePoint 指导库 也使用了属性包存储用于实现分层配置管理器.

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

这篇关于从/向分层对象存储读取/写入 - SharePoint 2007的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆