1

I am trying to add a new user in SPWeb with "limited access" as roleDefinition. But it shows error. But if i give "full control", read, design i'm able to add the user.

This is my code web.SiteUsers.Add(loginName, string.Empty, displayName, string.Empty);

What is the solution

john
  • 121
  • 1
  • 3
  • 17
  • What is the reason for adding them with Limited Access? I believe that role is managed by the system only... – Kit Menke Dec 16 '10 at 16:53

1 Answers1

3

LimitedAccess is only managed by the system and, as far as I know, cannot be set programmatically. This permission only exists to allow user(s) to traverse the site tree to retrieve content on which they have access.

You can create a custom permission level with nearly no right and assign it to your user if it's what you are looking for or you should update the permission to the relevant value on the targeted locations (items, webs, etc) in your site collection tree, SharePoint will then mark this user as a limited access user in the root site.