【发布时间】:2021-04-27 02:44:48
【问题描述】:
我需要找出我从 REST 调用返回的 principalId 编号的用户名或名称,该调用获取当前在 SharePoint 列表项上的角色分配。
我了解它可能涉及:
const r = await sp.web.lists.getByTitle('MyList').items.getById(theItem).roleAssignments()
我没有找到解释如何执行此操作的文档。
【问题讨论】:
我需要找出我从 REST 调用返回的 principalId 编号的用户名或名称,该调用获取当前在 SharePoint 列表项上的角色分配。
我了解它可能涉及:
const r = await sp.web.lists.getByTitle('MyList').items.getById(theItem).roleAssignments()
我没有找到解释如何执行此操作的文档。
【问题讨论】:
再次回答了我自己的问题:
const assignments = await sp.web.lists.getByTitle('MyList').items.getById(theItem).roleAssignments();
const expanded = assignments[0].PrincipalId;
console.log(expanded, 'expanded');
【讨论】: