-->
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.  [ 1 post ] 
Author Message
 Post subject: Authorization to limit Data access
PostPosted: Tue Dec 28, 2010 2:21 pm 
Newbie

Joined: Tue Dec 28, 2010 2:13 pm
Posts: 2
Hello,

I am working on a web application which using Struts2, Spring & Hibernate.

I am working on authorization which I think is necessary corss cutting feature of any application and needs to developed & kept very much isolated from the business logic.

I am elaborating my requirement in detail as follows,

Assume a simple action which is authorized to be called by sales dept people only. i.e showSales.action

When a user from purchase dept tries to call this action then, an interceptors will check whether the user in role has the authorization to access or not and deny access to purchase dept user to access this action this is simple.

I have implemented this using before advice of Spring AOP rather than interceptor. I hope i am not wrong?

But the bigger problem is

By how much, I mean for eg. if an sales execute logs in and clicks showSales.action then he must be get view of his own sales list, but when sales manager logs in and calls same action i.e showSales.action then he must get more* bigger n wider list, which can be union of data from all sales executives.

Here authorization of some kind must be implemented which intercepts DAO's and automatically sets the "where clause" in the sql query.


I tried before advice of spring for DAO's also but problem is if where clause is set somewhere within business logic then double where clause is set which gives error and because I am using hibernate criteria's to set restrictions on queries I have noticed this hibernate critera's are immutable* (Is there anyway to change them?)



what should be the best way to solve this problem. Any Design Pattern or something in hibernate that can help me here or something other advice for it?


--


With Best Regards,

Amol Ghotankar
Cursive Technologies Pvt. Ltd.
www.cursivetech.com


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

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.