使用Host-Provider方式开发的App,无法获取SharePoint Online中的item
来源:互联网 发布:win10 ssd优化设置 编辑:程序博客网 时间:2024/06/07 02:26
微软官方使用CAML读取Host Web上的list中的item的示例代码请参见:点击打开链接
我使用的代码为:
List selectedList = lists.GetByTitle("TestList");clientContext.Load<List>(selectedList); clientContext.ExecuteQuery();CamlQuery camlQuery = new CamlQuery();camlQuery.ViewXml = @"<View><Query><Where><In><FieldRef Name='ID' /></In><Values><Value Type="Counter">1</Value></Values></Where></Query></View>";Microsoft.SharePoint.Client.ListItemCollection listItems = selectedList.GetItems(camlQuery);clientContext.Load<Microsoft.SharePoint.Client.ListItemCollection>(listItems); clientContext.ExecuteQuery();
//执行以上代码之后,变量listItems一直是空的。
这段代码是参照示例代码编写,运行良好,但是突然读取不到host web中list的item了,读取的结果一直是空的。
查了半天代码,确定代码没有问题,最后才发现是App的权限不够,我之前赋予App的权限是Host web里List的Write权限。正确的权限设置是在AppManifest.xml中,Permissions标签页下将App在List上赋予Full Control的权限。如果不是Full Control,无法读取list中的item。这个变化应该是来自于SharePoint Online的权限更改,将读取host web中的item需要的权限提高导致的。
SharePoint Online以及整个Office 365一直处于不断的升级中,像这样的变化对app的影响还是很大的。从这里可以得到的一个经验是,为App赋予尽可能高的权限。
阅读全文
0 0
- 使用Host-Provider方式开发的App,无法获取SharePoint Online中的item
- SharePoint 2013 开发——Provider-hosted APP准备工作
- 申请免费的sharepoint online开发站点
- SharePoint 2013 app ---Provider Hosted app实战
- Sharepoint online 如何使用asp.net开发项目!!!
- 在SharePoint中使用WorkItem方式批量处理Item
- SharePoint Host Header Site Collection无法打开的解决方案
- SharePoint 2013 开发——开发并部署Provider-hosted APP
- Office 365 - SharePoint 2013 Online之添加App开发工具Napa
- sharepoint 2007 使用explorer 的方式打开文档库,无法复制大于50M的文件
- 使用SharePoint PowerShell 找出 In Progress 状态的Item
- sharepoint 开发常见错误的处理方式
- SharePoint Online 沙盒解决方案开发小结
- Sharepoint online 创建模板与使用模板
- SharePoint Online 创建和使用栏
- 使用正则表达式获取链接的Host
- ArcEngine开发过程中遇到axToolbarControl添加item变灰无法使用的解决方法总结
- 使用item获取item所在的文件夹(folder)
- jupyter快捷键
- HDU
- webservice学习笔记
- c++中四种类型转换
- 微信小程序正则判断手机号?
- 使用Host-Provider方式开发的App,无法获取SharePoint Online中的item
- 基本的编程规范
- Tornado源码白话解析01
- 软件架构的概念(1)
- Android使用MediaCodec硬解码播放H264格式视频文件
- 《Java设计模式之代理模式》
- MyBatis redis缓存
- PHP用户登录后跳转回上一访问页面的实现思路及代码
- 基于 FPGA 的 RS232 协议发送数据模块