0

In my scenario we want to customize the access request page. We already know how to create an application page, and with a powershell command, instruct sharepoint to use that page instead. http://blogs.msdn.com/b/ramg/archive/2009/11/06/supported-way-of-replacing-application-pages-in-layouts-directory.aspx

When the user gets to that page he will be able to send a custom message to the person responsible, the custom app page we are creating will also put access requests on a custom list.

When the admin checks the custom list, there will be an Approve and Reject buttons for each item in the list.

The questions is how to approve programatically an access request?

1
  • or at least how to set the permission to a site by code? Feb 10, 2012 at 10:25

1 Answer 1

1

If my understanding is correct, you may want to add the user who created the request into a SharePoint group so that he gets the permission automatically. the code for that look something like:

string login = "UserName";
string groupName = "Group";
SPUser user = SPContext.Current.Web.EnsureUser(login);
SPGroup group = SPContext.Current.Web.Groups[groupName];
group.AddUser(user);
1
  • how to do the same using Client Object Model?
    – Jay
    Nov 19, 2013 at 5:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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