SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a requirement to grant a department contribute to their department parent & child sites. The catch is, they also want to be able to grant & remove contribute to outside department users. If I were to create a field called "Contribute Members" to a list on a site, could I have an event receiver grant/remove AD users contribute when the form is saved?

share|improve this question
up vote 3 down vote accepted

Of course, you could.

Some key articles for you to start with:

  1. SPSecurity.RunWithElevatedPrivilegies - this will allow you to elevate privilegies for current user
  2. SPFieldUserValue and SPFieldUserValueCollection - these classes will help you to extract values from "Person or group" column.
  3. SPWeb.EnsureUser method - will help you to ensure that AD user is added to a site
  4. SPGroup.AddUser method - will allow you to add users to SharePoint groups of a site, providing appropriate privilegies to them

Feel free to ask, if you need more details for any step.

share|improve this answer

That is one of the common uses of Event Receivers : to take actions the users themselves might not be able to do due to UI or security restrictions.

share|improve this answer
sounds great in theory, right! – JR_ATLDev Apr 29 '11 at 17:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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