DB2 Version 9.7 for Linux, UNIX, and Windows

authority_bitmap - User authorization level monitor element

The authorities granted to the user and to the groups to which the user belongs. These include authorities granted to roles that are granted to the user and to the groups to which the user belongs. Authorities granted to a user or to roles granted to the user are considered user authorities. Authorities granted to a group to which the user belongs or to roles granted to the group to which the user belongs are considered group authorities.

Table 1. Snapshot Monitoring Information
Snapshot Level Logical Data Grouping Monitor Switch
Application appl Basic
Application appl_info Basic
Table 2. Event Monitoring Information
Event Type Logical Data Grouping Monitor Switch
Connection event_conn -

Usage

The authority_bitmap monitor element has the format of an array. Each array element is a single character that represents whether or not the user ID has been granted a specific authority and how the user has received that authority.

Individual array elements are indexed through an index value defined in the sql.h file. The value of an index in the authority_bitmap array is called an authority index. For example, SQL_DBAUTH_SYSADM is the index to determine if the user has SYSADM authority.

The value of one element in the authority_bitmap array identified by an authority index represents whether the authority is held by an authorization ID. To determine how the authorization ID is held, for each array element identified by the authority index, use the following defines from sql.h:
SQL_AUTH_ORIGIN_USER
If this bit is on, then the authorization ID has the authority granted to the user or to a role granted to the user.
SQL_AUTH_ORIGIN_GROUP
If this bit is on, then the authorization ID has the authority granted to the group or to a role granted to the group.
For example, to determine if a user holds DBADM authority, verify the following value:
authority_bitmap[SQL_DBAUTH_DBADM]
To determine if the DBADM authority is held directly by the user, verify the following:
authority_bitmap[SQL_DBAUTH_DBADM] & SQL_AUTH_ORIGIN_USER