【问题标题】:How do I find out the name from a Principal Id when using pnp sp?使用 pnp sp 时如何从 Principal Id 中找出名称?
【发布时间】:2021-04-27 02:44:48
【问题描述】:

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

我了解它可能涉及:

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

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

【问题讨论】:

    标签: rest spfx pnp-js


    【解决方案1】:

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

    const assignments = await sp.web.lists.getByTitle('MyList').items.getById(theItem).roleAssignments();
    
    const expanded = assignments[0].PrincipalId;
    
    console.log(expanded, 'expanded');
    

    【讨论】:

      猜你喜欢
      • 2021-01-30
      • 2019-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多