Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要找出我从 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');