Ok i see
,
But if i Wont to filter the List of Positions in the Order when the user calls the following:
Code:
Order o = OrderManager.getOrder(1);
List<Position> positions = o.getPositions();
Since my Order is a Hibernate Bean the User will get all of the Positions when he calls getPositions().
Even if there is an option to do something like that:
Code:
@Service("orderManager ")
public class OrderManager {
// filterObject refers to the current object in the collection
@PostFilter("hasPermission(returnValue.getPositions().filterObject, 'READ')")
public Order getOrder() {
// Return our new list
...
}
...
}
But I think something like that is not possible. (I wonted to filter a Collection inside the returnObject!
But I found a alternative solution: I can use Hibernate Filters. I hope this will do the trick, and the good thing is, the filtering will be done in the SQL statement! The Bad thing is, it will just work, when i use Hibernate!
Thx for the help!