(CVAL('ISOWNER'))
Returns the value of YES when the current user has OWNER permissions, and NO when the user does not.
(TINFO(arg1,arg2,arg3))
Returns access right information for the current user.
Where: arg1 is zero (0), which specifies to show table permissions
arg2 is the system table ID (SYS_TABLE_ID) value (can be located in the SYS_TABLES system table)
arg3 can be:
a) A specific system column ID (SYS_COLUMN_ID) in that table
b) A value of 0 which means show permissions that apply to all the columns in that table
c) A value of -1 which means show permissions that apply to any of the columns in that table
Remarks:
•TINFO returns a comma delimited string of the access rights.
•In most instances table and column privileges are identical. Cases where they are not are autonumber column (no INSERT), computed columns, (no INSERT or UPDATE), and where the UPDATE privilege was granted to specific columns only.
•Permissions are returned based upon the current USER.
Examples:
The following example is based upon a database configured with an OWNER and users, where limited permissions are supplied to a user Jim for the Component table.
While connected to the database as the OWNER, the system table ID and system column ID can be found for the Component table and CompDesc column.
SELECT SYS_TABLE_ID FROM SYS_TABLES WHERE SYS_TABLE_NAME = 'Component'
SYS_TABLE_ID
------------
29
R>SELECT SYS_COLUMN_ID FROM SYS_COLUMNS WHERE SYS_COLUMN_NAME = 'CompDesc'
SYS_COLUMN_ID
-------------
188
R>SET USER JIM JIM999
Example 01:
-- Permissions for the column CompDesc
R>SET VAR vUserInfoColumn = (TINFO(0,29,188))
R>SHOW VAR vUserInfoColumn
SELECT, UPDATE
Example 02:
-- Permissions for all column. Only SELECT is returned since that is the only permission applied to all columns.
R>SET VAR vUserInfoAllColumns = (TINFO(0,29,0))
R>SHOW VAR vUserInfoAllColumns
SELECT
Example 03:
-- Permissions for any column. Both SELECT and UPDATE are returned since there are some columns with both of those permissions.
R>SET VAR vUserInfoAnyColumn = (TINFO(0,29,-1))
R>SHOW VAR vUserInfoAnyColumn
SELECT, UPDATE