We have requirement to Give particular access to the USER using their email ID , on List item with REST call. We are clear with the steps to be followed. the only change we are seeing is with the endpoint addroleassignment. As per the documentation at MSDN , we have to pass PRINCIPALID and ROLEID.
We are ok with ROLEID. However, principalID is the userID.
Now there are ways to find this UserID using other endpoints (/SiteUser), we can pass email ID and get this Principal ID.
Challenge
AFAIK the PrincipalID that we get through site user end point is generated only when that user actually visits the sharepoint site. So if there is an Organization with 50K employees, we will not see all these employees listed with their userID using /SiteUsers endpoint.
May I know, how do we give an access to the users on list item which never visited the site and hence will not have any userid .
MSDN documentation says its Int32, so what are my options (can the membership name work? i#[email protected] etc?)
please help.
Update 1:
My assumption that UserID gets generated only when the user actually visits was WRONG. behavior is, whenever we add a user to sharepoint site through Group, direct permissions etc. then UserID gets generated for that User. Being said that, original issue remains.