SPRole.AddUser Exception - Unique Permissions
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
SPRole.AddUser Exception - Unique Permissions

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
ori
Guest





Posted: Fri Jan 28, 2005 4:49 pm    Post subject: SPRole.AddUser Exception - Unique Permissions Reply with quote

Hi,

I'm trying to add users to roles in a sharepoint site via Object Model.
however, when I run the method SPRole.AddUser I get an exception saying
"This operation is available only for a web with unique permissions". I
set the web's HasUniquePerm property to "true" before adding the user
but I keep getting the same exception.

Here's the code:

web.HasUniquePerm = true;
SPRole spRole = web.Roles["role_name"];
spRole.AddUser("loginName", "email", "name", "notes");

and I get the exception I told.
Thx in advance, any help will be appreciated,
ori
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB