Spring & Hibernate: block user from writing

I need one user not to write to the database, is there any way to achieve this without changing all save or update cases? I thought I need to wrap the hibernate session. What would you advise me to do?

thanks Sebastian

+3


source to share


2 answers


I ended up using the Hibernate interceptor. If I implement onSave (), onDelete () and onFlushDirty (), is there any way to bypass these methods and write to db? If not, I am very happy with this solution. Because, as it turns out, that user is not allowed to read some of the fields.



0


source


I recommend using a security framework like Spring Security or Apache Shiro to implement cross-cutting security concerns at the application level.



+2


source







All Articles