Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a process which runs in a event receiver, this involves adding users from ad to groups based on the contents of a custom list.

The problem occurs when i try to add a user into a group that i am not a member of (or whoever the logged in user is).

I am in sandboxed solution so i cant use RunWithElevatedPrivelages.

Is there any way to get around this limitation?

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

As other suggested the limitation is indeed put in place as a security measure. Under normal condition sandboxed solutions shouldn't be able to perform privilege elevation as that would enable them to escape the security context of the sandbox. So I fear there is no built in way to perform what you are asking directly.

That said, if you just have to another solution comes to mind. You could implement a full-trust proxy that will perform the required operations outside of the sandbox limits. This way you are delegating the task to an "external" module that is defined as "trusted" by your SharePoint farm. There are many tutorial about this (on msdn or extarnal blogs), but keep in mind that a full trust proxy is actually a farm solution, so you need to ensure that you are actually allowed to use it (trad: ensure there aren't random policies created by the standard SharePoint it admin mad-hatter) before starting.

share|improve this answer
add comment

No, it's entirely by design. To do this either the user(s) needs permissions, or you need to run elevated.

share|improve this answer
    
As Marcus stated. Your "limitation" is actually the security doing its job. –  MAllen22842 Jan 16 '13 at 3:22
add comment

If you don't need to add users to group imediately, you can create list with 2 columns - user, group - add here your desired value pairs and every hour/day run timer job on this list.

share|improve this answer
1  
He said that he uses a sandbox solution so a timer job is out of the question. –  Alex Choroshin Jan 15 '13 at 23:13
add comment

Your Answer

 
discard

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.