2

I have site that has unique permissions.

I have a SharePoint group that has permissions for that site.

If I add a user to the SharePoint group through the SharePoint UI, the user can immediately get to the site.

If I remove the user from the SharePoint group through the SharePoint UI, the user immediately loses access.

This is terrific.

However, when I use CSOM to add the user to the Group, I can see the user has been added to the group if I look at the group membership, but the user does not have immediate access to the site. I do believe that eventually the user does gain access to the site, but I can not predict when that happens. Can anyone explain why this is? Or at least validate that this is true?

(It also appears that removing the user from the group with CSOM immediately removes the user's access.)

0

The issue is that my environment allows both Claims and Forms authentication.

Because of this, it is necessary to convert a LoginName to a WindowsClaim. I did this by hardcoding "i:0#.w|" to the start of the LoginName and everything worked.

I don't know if this string is the same for everyone, but you can find it by looking at the details of a user that was added via the UI.

This took me way too long to figure out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.