-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Using LoadEventListener to deny access to objects
PostPosted: Thu Feb 19, 2009 8:45 am 
Newbie

Joined: Wed Oct 29, 2008 6:29 am
Posts: 7
Location: Liège, BE
Hello,

i'm trying to securize access to objects retrieved through internal relationships.

Description :
i'm using hibernate to persist an object model that uses row-level security, i.e. allow authorized users to see data on a per-object basis.
Object-level security is persisted using dedicated entities.
This is done and works well by doing query rewriting in HQL.

However, consider this :
user 'foo' is retrieving an object A that has a relationship (like OneToMany) to another set of objects B. 'foo' is allowed to see A, but not all instances of B.
But in this case, query rewriting will not be invoked, since fetching of B will be done internally by hibernate.

To solve this, i'm trying to overload the DefaultLoadEventListener, so that on each occurence of an INTERNAL_* load event, it checks the object level security for the current user, and removes the object from the event if needed.
*but* this solution fails because removing the object from the event results in a "row no found" exception.

Am I going the right way by trying to implement this using a LoadEventListener ?
Does anyone have some experience with that kind of usecase ?

thank you,

--p.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2009 8:49 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
For toMany-relationships filtersare designed to restrict views on data.

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.