-->
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: Row Level Security in Hiibernate
PostPosted: Tue Jun 15, 2010 5:16 pm 
Newbie

Joined: Tue Jun 15, 2010 4:26 pm
Posts: 1
I am considering implementing row level security using the Interceptor method for my application.

I know I need extend the EmptyInterceptor, but have a question about when methods are called. When an object is loaded from the database, the interceptor's onLoad event is called. Once it is loaded, it is maintained in the cache until such time as the space needs reclaiming. While it is in the cache, if another user requests that object will the onLoad even be called again.

The reason I ask is that if I put my RowSecurity at this level, will the security be circumvented by cached objects. The scenario I am envisioning is as follows: User1 requests Object1. The onLoad even is called and the authorization passes for User1 and the object is returned. User2 requests Object1(but they should not have access according to the custom interceptor). If the onLoad method of my custom interceptor is not called it just be returned and thereby circumventing security.

Is the onLoad only called when being loaded from the database or is it called when being returned from the cache as well.

Thanks in advance!


Top
 Profile  
 
 Post subject: Re: Row Level Security in Hiibernate
PostPosted: Wed Jun 16, 2010 3:03 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Note that Hibernate has both a first-level cache and a second-level cache... I am not sure which cache you are talking about.

In any case, the onLoad method is called whenever the object is loaded from the database or the second-level cache, but not from the first-level cache. But the first-level cache is always bound to a session and a session should not be shared between different users.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.