Forums de discussion

Restrict search results within User Group

Ali Saithumuhammed, modifié il y a 10 années.

Restrict search results within User Group

New Member Publications: 2 Date d'inscription: 28/10/13 Publications récentes
I am using Liferay CE 6.1.2.
I have a requirement to restrict the search result of 'Web Content Search' portlet based on the user group.
For example there are three user groups g1, g2 and g3.
Users u1 and u2 belongs to group g1
Users u3 and u4 belongs to group g2
Users u5 and u6 belongs to group g3.

u1 and u2 have view permission only to articles come under group g1.

Search results should include only those articles come under g1 even though there exists the matching ones in group g2 and g3.

Default Web Content search portlet is displaying all matching articles irrespective of the access permission.
Any suggestions to resolve the same?
thumbnail
Kan Zhang, modifié il y a 10 années.

RE: Restrict search results within User Group

Junior Member Publications: 68 Date d'inscription: 01/12/10 Publications récentes
Hi Ali,

I cannot reproduce the problem you have described above in a fresh installed Liferay CE 6.1.2 instance.

What I did was:
1. Created two User Groups:
- User Group 1
- User Group 2

2. Created two Roles:
- Role 1
- Role 2

3. Created two users:
- User 1
- User 2

4. Associated the following relationships:
- User 1 -> User Group 1 -> Role 1
- User 2 -> User Group 2 -> Role 2

5. Created one web content called TEST CONTENT. Set the view permission ONLY to Role 1. So only User 1 has view permission which is inherited from User Group 1 inherited from Role 1

6. Login as User 1, perform the search using Web Content Search portlet. The search result shows the TEST CONTENT.

7. Login as User 2, perform the search using Web Content Search portlet. The search result DOES NOT show the TEST CONTENT. (Because Role 2 does not have view permission on TEST CONTENT)

Looks like everything is working properly for me.
Ali Saithumuhammed, modifié il y a 10 années.

RE: Restrict search results within User Group

New Member Publications: 2 Date d'inscription: 28/10/13 Publications récentes
Hi Kan Zhang,

Thanks for your reply.

I found a fixed defect with liferay version 6.1 which is fixed in later versions 6.1.20 EE GA2, --Sprint 11/12, 6.2.0 CE M2 .

Please refer the link https://issues.liferay.com/browse/LPS-26001 for more details.

Thanks,
Ali