Skip to content

Commit

Permalink
SAM-2514 make sure to filter available pools on ACCESS_DENIED
Browse files Browse the repository at this point in the history
  • Loading branch information
raulsv authored and ottenhoff committed Mar 19, 2015
1 parent 466a1e4 commit 4d97ede
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1428,8 +1428,10 @@ public HashMap<Long, Integer> getCountItemFacadesForUser(final String agentId) {
final HibernateCallback hcb = new HibernateCallback(){
public Object doInHibernate(Session session) throws HibernateException, SQLException {
Query q = session.createQuery("select qpi.questionPoolId, count(ab) from ItemData ab, QuestionPoolItemData qpi, QuestionPoolData qpd, QuestionPoolAccessData qpad " +
"where ab.itemId=qpi.itemId and qpi.questionPoolId=qpd.questionPoolId AND qpd.questionPoolId=qpad.questionPoolId AND qpad.agentId=? group by qpi.questionPoolId");
"where ab.itemId=qpi.itemId and qpi.questionPoolId=qpd.questionPoolId AND qpd.questionPoolId=qpad.questionPoolId AND qpad.agentId=? AND qpad.accessTypeId!=? " +
"group by qpi.questionPoolId");
q.setString(0, agentId);
q.setLong(1, QuestionPoolData.ACCESS_DENIED);
q.setCacheable(true);
return q.list();
};
Expand Down

0 comments on commit 4d97ede

Please sign in to comment.