0

我需要找出我从 REST 调用返回的 principalId 编号的用户名或名称,该调用获取当前在 SharePoint 列表项上的角色分配。

我了解这可能涉及:

const r = await sp.web.lists.getByTitle('MyList').items.getById(theItem).roleAssignments() 

我发现没有解释如何执行此操作的文档。

4

1 回答 1

0

再次回答了我自己的问题:

const assignments = await sp.web.lists.getByTitle('MyList').items.getById(theItem).roleAssignments();

const expanded = assignments[0].PrincipalId;

console.log(expanded, 'expanded');
于 2021-01-22T15:59:05.687 回答