Bug #1610: Fix problem accessing company view with limited permissions
When the user had restricted access to the company view, and the list of specific projects that he could read is empty, an HibernateQueryException was being raised. FEA: ItEr77S04BugFixing
This commit is contained in:
parent
1d1473b9a5
commit
a7adf8429f
1 changed files with 7 additions and 3 deletions
|
|
@ -442,12 +442,16 @@ public class OrderDAO extends IntegrationEntityDAO<Order> implements
|
|||
} else {
|
||||
String strQuery = "SELECT oa.order.id "
|
||||
+ "FROM OrderAuthorization oa "
|
||||
+ "WHERE oa.user = :user "
|
||||
+ "OR oa.profile IN (:profiles) ";
|
||||
+ "WHERE oa.user = :user ";
|
||||
if (!user.getProfiles().isEmpty()) {
|
||||
strQuery += "OR oa.profile IN (:profiles) ";
|
||||
}
|
||||
|
||||
Query query = getSession().createQuery(strQuery);
|
||||
query.setParameter("user", user);
|
||||
query.setParameterList("profiles", user.getProfiles());
|
||||
if (!user.getProfiles().isEmpty()) {
|
||||
query.setParameterList("profiles", user.getProfiles());
|
||||
}
|
||||
|
||||
return query.list();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue