Manage permission with roles instead of sharepoint groups

Nov 15, 2011 at 8:42 PM

I would like to manage permission in the SQL asp.net db instead of in sharepoint. 

Currently when I Approve a membership request, the user is added to a sharepoint group.  Is there a way I can automatically add them to a role instead when I click approve in the membership request dialogue? 

In membershiprequest.cs, I tried to change the code to automatically add the user to the role.  It works great with Review Membership Requests unchecked.  But isn't so hot when I turn it back on. 

Anyway, just wondering if you have any ideas?

 //Add the user to the default group

 

if (!String

.IsNullOrEmpty(request.DefaultGroup))

{

 //web.SiteGroups[request.DefaultGroup].AddUser(Utils.EncodeUsername(request.UserName.ToLower(), web.Site), request.UserEmail, request.FirstName + " " + request.LastName, "Self Registration");

 

Roles.AddUserToRole(request.UserName, "FBA_MP_Customer")

 

 

 Thanks,
Justin

 

 

 

 

 

 

 

 

Coordinator
Nov 15, 2011 at 8:57 PM

That looks ok to me.  DefaultGroup should always be populated, but maybe try removing the IF statement in case it's not for some reason.

If you want this in the main code, put a feature request in the issue tracker and i'll consider it for a future release.