Check current permissions?
Posted in 2004
Topics: Connectivity: ODBC / JDBC / .NET
Hi everyone, I have an open ODBC connection to our Informix server and would like to determine what permissions the connection has on different tables. I've checked out DBINFO, but don't see anything that would help me. I've also looked into the INFO command, but I don't think I can issue an SQL statement that includes that command the way I can with DBINFO. Any suggestions? -- William Fields MCSD - Microsoft Visual FoxPro MCP - Win2k Pro US Bankruptcy Court Phoenix, AZ "Don't look back - we're not going that way." - Terry Hunefeld
William Fields wrote: > I have an open ODBC connection to our Informix server and would like to > determine what permissions the connection has on different tables. I've > checked out DBINFO, but don't see anything that would help me. I've also > looked into the INFO command, but I don't think I can issue an SQL statement > that includes that command the way I can with DBINFO. You're going to need to know the current user (session authorization) and current role (if any). For each table, you take the union of the privileges for the current user, current role and PUBLIC. You poke in systabauth and syscolauth sometimes. You also poke at sysprocauth. And you review sysusers (heaven help you if it contains an entry asserting that PUBLIC is a DBA). There isn't a single statement that can do that - though DB-Access's INFO PRIVILEGES statement might help a bit. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/