I need to set a Person or Group filed using javascript client object model. What I have in my hand is the sid of the user, something like i:0#.f|membership|myalias@company.com and even the full name of the user.
Note that it is not the current user that I am talking about. I have a people picker field in newitem/edititem form and I am grabbing the sid of the user that is entered in the people picker box by using some jquery code, basically traversing through the DOM. Now, once I have this id/full name of the user, I need to set a field that is Person or Group type.
Another thing is, lets say I used ensureUser method(I don't know how exactly to use it yet), will it give access to the user entered in the box, to the site? I mean, I might enter someone's name in GAL in the people picker box but that doesn't mean that he/she should get access to the site. I think ensureUser gives access to the site which I don' t want.
Is there any way to do this?