Show Grants, is there an easier method?
Posted by: George Vieira
Date: January 08, 2005 08:55PM

I'm just starting on the .NET connector and it works well but what I would like to do is allow the program I'm creating to know what fields the user who connects to the database has access to, whether it's select only or update or insert as well..

I tried doing SHOW GRANTS FOR {username} but the info that returns is different between users.

One user may return :

GRANT SELECT (id, name, number, jobnumber), UPDATE (number) ON `testdb`.`clients` TO 'admin'@'%'

Another may show just this :

GRANT SELECT ON `servicecentre`.`parts` TO 'sc-booking'@'%'

So I tried to enumerate the data returned into a collection of some sort so you can query it with something as simple as :


and it will return some like "select,insert,update" etc.etc.. which is working but I'm still getting changes from time to time which my routine doesn't catch the returned SHOW GRANTS data and causes exceptions... I GIVE UP..

I can't find any commands to find what is granted to the user easily.. Is there a dumb a__ easier way?

tell my i wasted my time.. :P

Options: ReplyQuote

Written By
Show Grants, is there an easier method?
January 08, 2005 08:55PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.