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: Authorisation changes to objects
PostPosted: Wed Jul 18, 2007 7:41 am 
Beginner
Beginner

Joined: Thu May 31, 2007 1:19 pm
Posts: 23
Hi

Users need specific authorisation to update specific properties for given objects in our model.

Now, I can (and will) hook the UI to enable/disable columns, text boxes etc. but I would also like to enforce the rules at the object level.

Now, I know I can use an interceptor to check what properties have changed when an object is saved or the session is flushed.

My question is, is there there some way to detect as a property is changed. I would imagine if this where possible, it would need a proxied object and the hooking of the setter?

If so, can someone tell me how to ensure that I get only proxied objects as the result of a query?

I.e. session.CreateQuery("from Object").List() returns a collection of proxied objects

Many thanks,
Mark.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 18, 2007 6:32 pm 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
If you use a mapping strategy of field rather than property, you can put these authorization checks directly in the property setters, since then NHibernate will never read or write to the property. It's not really an NHibernate issue.


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.