1

I am using Alfresco community 5.0.d.

I am looking for a way to prevent Site A member's to search for Site B member's & vice-versa followed with other details of 2 different site's.

For instance, siteA members, they should be able to view and select allSites-workflows & siteA-workflows along with that site members. siteB members can only view and select allSites-workflows & siteB-workflows along with that site members.

Thanks in advance!

nikhil84
  • 3,235
  • 4
  • 22
  • 43

2 Answers2

3

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.

  • Thank you for the answer but could you tell me which file do I need to modify? as in location and name of file. I am using all in one sdk for modification and have alfresco community 5.0.d – nikhil84 Dec 21 '16 at 13:31
  • 1
    We didn't use the SDK. Initally we customised on 4.x and now we are in 5.0 enterpirse version. Let me give the files list asap. – Muralidharan Deenathayalan Dec 21 '16 at 13:35
  • OK sure. I will try to find the files that you will provide and workaround it. Thank you! – nikhil84 Dec 21 '16 at 13:36
  • Could you share the list of files to be modified for this changes? Also I want to restrict the search of member to that site only. Site-A member can search for members from Site-A only. Thanks – nikhil84 Jan 03 '17 at 11:05
0

Fixed this issued by

  1. Peopler finer component: Overriding the people-finder.js (PATH: /Applications/alfresco-5.0.d/tomcat/webapps/share/components/people-finder/people-finder.js)
  2. Live search: Removed the people suggestion from the live-search.

For modifying the live-search part, refere to stack-overflow answer

Thanks!

Community
  • 1
  • 1
nikhil84
  • 3,235
  • 4
  • 22
  • 43