When you’re developing custom code for SharePoint, sometimes you’ll have a situation where you’re dynamically adding form field controls to your control or WebPart and the form context will not be automatically picked up by the controls. If you’re using them outside a new, display or edit form for example.
It’s relatively simple to force the control(s) to the desired context but there’s something you should be aware of.
Take a look the following code:
If you’re using a PeopleEditor control in your solution and enforce the filtering of selectable users by specifying a SharePoint group in the SharePointGroup property you may see the following error instead of the PeopleEditor control:
“The control is not available because you do not have the correct permissions”
This can happen if the context user does not have adequate permissions against the SharePoint group you specified as the filter group.
For instance, if you create a dummy group to contain the filtered set (where the users are also part of another group which grants them specific permissions) and do not grant any permissions to it when creating, it this error will occur for the majority of users, except the admin users.