I'm implementing security constraints on data objects using Hibernate's Interceptor interface. What I'd like is the option to filter query results according to the user's security level. In other words, if the user does not have access to the persistent object instance, then make it look like the instance doesn't even exist in the DB. A query for one user might return only 10 instances, while the same query for a more privileged user might return 100 instances. I'd like to do this somewhere where it would be completely transparent to the rest of the system, and the Interceptor seems like the logical place. However, it doesn't look like provision is made for the interceptor to veto the loading of an instance. Anyone know of an alternate solution?
|