From d6181646e021ca5727d963b9fd94a62f4e070ea5 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 8 Apr 2013 13:01:12 +0000 Subject: [PATCH] Fix of study visibility for readers. --- .../src/org/splat/service/SearchServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Workspace/Siman-Common/src/org/splat/service/SearchServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/SearchServiceImpl.java index 2d2a2db..9c9182d 100644 --- a/Workspace/Siman-Common/src/org/splat/service/SearchServiceImpl.java +++ b/Workspace/Siman-Common/src/org/splat/service/SearchServiceImpl.java @@ -435,6 +435,14 @@ public class SearchServiceImpl implements SearchService { + "select rel.owner from contributor_rel rel " + "where {alias}.rid = rel.owner AND rel.refer = ?)", actorId, Hibernate.LONG)) + .add( + /* If the user is reader */ + Restrictions + .sqlRestriction( + "{alias}.rid in (" + + "select rel.owner from reader_rel rel " + + "where {alias}.rid = rel.owner AND rel.refer = ?)", + actorId, Hibernate.LONG)) .add( /* If the user is author */ Restrictions.eq("study.manager.rid", actorId)).add( -- 2.39.2