pnp / pnpjs

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs
https://pnp.github.io/pnpjs/
Other
740 stars 300 forks source link

Add SP Siteusers addById() method #3073

Closed RoelVB closed 6 days ago

RoelVB commented 2 weeks ago

Category

What's in this Pull Request?

This PR adds the addUserById() method to be able to add siteusers using their ID.

patrick-rodgers commented 6 days ago

Hey, what does this do? Doesn't the user id come from when you add the user to the site? Can you help us understand what this update is for?

RoelVB commented 6 days ago

We have removeById() and removeByLoginName(), but for some reason for adding we only had a method for using the loginname. This PR adds the option be able to also add users by their ID.

RoelVB commented 6 days ago

I now understand why this PR is confusing. This same method is used by site-groups here: https://github.com/pnp/pnpjs/blob/73889b4c798e65e7dd06a21384f73066fe2edbf9/packages/sp/site-groups/types.ts#L70-L72

In that context the method makes sense, but it doesn't for siteusers.

juliemturner commented 6 days ago

So I think we're just going to close this as I don't think it's needed.