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.  [ 7 posts ] 
Author Message
 Post subject: Database permissions
PostPosted: Thu Jan 08, 2009 7:14 pm 
Newbie

Joined: Thu Jan 08, 2009 6:57 pm
Posts: 4
Hi,

I am new to NHibernate and thinking of using it in one of my projects. One of the problem i found is that NHibernate requires direct delete and update access to the tables. I don't want to grant permissions on tables for everyone. With the stored proc approach, we can set the user accesses on queries to avoid unauthosized access to the tables. How can i do it in NHibernate?

Thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 09, 2009 3:04 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
You can use custom sql statements for update/delete:

http://nhforge.org/doc/nh/en/index.html#querysql-cud

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 09, 2009 1:52 pm 
Newbie

Joined: Fri Jan 09, 2009 1:23 pm
Posts: 3
Why do you need to grant permissions for everyone? Can't you just grant permissions for the user you are using to access the Database?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 10, 2009 10:09 am 
Newbie

Joined: Fri May 25, 2007 5:06 am
Posts: 11
megacan wrote:
Why do you need to grant permissions for everyone? Can't you just grant permissions for the user you are using to access the Database?


I agree with this solution. In addition, it's usefull to create your own user/roles/permissions managemnt on the application level.

Keep in mind that your users will deal with application objects (which are not always just a reflection of database's counterparts), not database objects, so sooner or later you will have very complicated security management if you don't handle permissions in the right place.

_________________
Regards,
Thomas

NConstruct - NHibernate code generation tool


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 11, 2009 5:18 pm 
Newbie

Joined: Thu Jan 08, 2009 6:57 pm
Posts: 4
[quote="wolli"]You can use custom sql statements for update/delete:

[url]http://nhforge.org/doc/nh/en/index.html#querysql-cud[/url][/quote]

Hi, thanks for your reply. Can you please give me more details on how to do this?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 11, 2009 5:50 pm 
Newbie

Joined: Thu Jan 08, 2009 6:57 pm
Posts: 4
[quote="megacan"]Why do you need to grant permissions for everyone? Can't you just grant permissions for the user you are using to access the Database?[/quote]

Sorry for not making it clear. I don't want to grant update and delete permissions directly on tables. [/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2009 2:55 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Hi minocan,

hjave a look at the link to the documentation in my posting, it's all there. I haven't used sp's myself with hibernate, so I can't give you more. But you can search the forum or the nhusers group at google.

_________________
--Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.