We had similar customisation in our organaisation. We restricted the users to search only the current members in the workflow assignee field. To achieve this, We passed extra siteid and the search looks only the members from the given site.
Here is the example for the people picker for Adhoc workflow.
http://localhost:8080/share/proxy/alfresco/api/forms/picker/authority/children?selectableType=cm:person&searchTerm=adm&size=1000&siteId=mysite
We extended searchUsers method from
org.alfresco.repo.security.authority.script.ScriptAuthorityService
public ScriptUser[] searchUsers(String nameFilter, ScriptPagingDetails paging, String sortBy, String siteName)
{......
Map<String, String> siteGroups = this.serviceRegistry.getSiteService().listMembers(siteName,nameFilter,null,MAX_RESULTS,true);
Set<String> allAuthorities = siteGroups.keySet();
List<String> authorities = new ArrayList<String>();
for(String authority : allAuthorities)
{
if (!authority.startsWith("GROUP_"))
{
authorities.add(authority);
}
}
.......
}
Please let me know, if you need to more help on this.