Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting up Groups

Status
Not open for further replies.

DB2NewB

Programmer
Aug 9, 2002
5
US
This must be one of those things that IBM believes is too trivial to include in its extensive documentation (such as how to set up a password for a new user).

I want to set up groups so that users in that group only have certain privileges on certain tables. Setting up the groups is easy enough, but how do I add the users to the group?

I'm using DB2 UDB 7.2 on NT4.0 Service Pack 6
 
For DB2 7.2:

Create the Group in NT
Add the group to the DB2 databse:
db2 groupadd groupname
Grant on the group:
db2 grant update on table schema.tablename to group groupname
 
sorry, I didnt answer your question, did i?

I hate Mondays.

You add your users to the group using the Windows user and passwords management.

 
Thanks lydiap! I figured it might have something to do with OS security, but running the GRANT statement was the last peice I needed.

One more question though. How can I tell if a user is a memeber of a certain group? Is there a way to query the system tables to discover this?
 
In DB2, groups and users are handled strictly at the OS level. So in order to figure out what users are in which groups, you need to look at the OS level. For NT, look in the User Manager. For Unix/Linux run the 'cat /etc/passwd' command.
 
Maybe this should have its own thread, but its pretty much in line with what we've been discussing. Here is my situation. I have a VB app that needs to enable/disable some of its features depending on the privileges a user has. Those users are part of groups in DB2, so I would need to know what group that user is a part of to determine what to disable and what to enable.

Knowing that all the group and user stuff is being taken care of by the OS, looks like I might be out of luck. But I was wondering if its possible to create a stored proceedure to get this information and return it back to the VB program. Any thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top