Primary AuthIDs, GroupIDs and SecondaryIDs can be used in combination when setting up system security. These IDs are defined and used as follows:
The table and the descriptions following it illustrate how various GroupID and SecondaryID assignments can affect the naming of and access to database objects.
When security is on, the Primary AuthID and Password are used when each user (or process) logs in to the XDB Server. The system then checks the SYSXDB.SYSACFUSERS table for the existence of a SecondaryID. If present, the user (or process) assumes the identity of the SecondaryID and is accorded all privileges that have been defined for the SecondaryID. If no SecondaryID exists for the user, then privileges are based on what has been granted for the Primary AuthID and the groups to which it belongs.
To grant a particular set of privileges to a group of users, without having to define those privileges for each user individually, assign multiple users to the same SecondaryID. Grant the privileges to the SecondaryID (essentially just another AuthID). However, the preferred method for assigning the same privilege set to many users is to use the XDB Group, which is similar to the DB2 concept of assigning multiple secondary authorization IDs to a primary authorization in IBM's RACF (Resource Access Control Facility).
Primary AuthID | Secondary ID | Group Name | Creates Table... (see note 1) | Owner | Authorized Users |
---|---|---|---|---|---|
TECHPUBS | -- | -- | Created as a Primary AuthID. Privileges are assigned. Used as a SecondaryID for one or more Primary AuthIDs. | ||
-- | -- | WRITERS | Created as a group. Privileges are assigned to the group. GroupIDs are assigned to Primary AuthIDs. | ||
ERIC | -- | -- | ERIC.
TABLE1 |
ERIC | ERIC |
DEBBIE | -- | -- | DEBBIE
TABLE1 |
DEBBIE | DEBBIE |
DAVID | -- | WRITERS | DAVID.
TABLE1 |
DAVID | DAVID and
if access is granted to WRITERS, then also ARLENE. |
ARLENE | -- | WRITERS | ARLENE.
TABLE1 |
ARLENE | ARLENE and
if access is granted to WRITERS, then also DAVID. |
ROCHELLE | TECHPUBS | -- | TECHPUBS.
TABLE1 |
TECHPUBS | Users with TECHPUBS as SecondaryID (ROCHELLE, STEVE, PABLO, BRUCE) and
if access is granted to WRITERS, then also DAVID, ARLENE. |
STEVE | TECHPUBS | -- | TECHPUBS.
TABLE2 |
TECHPUBS | Users with TECHPUBS as SecondaryID (ROCHELLE, STEVE, PABLO, BRUCE) and
if access is granted to WRITERS, then also DAVID, ARLENE. |
PABLO | TECHPUBS | WRITERS
(ignored, see note 2) |
TECHPUBS.
TABLE3 |
TECHPUBS | Users with TECHPUBS as SecondaryID (ROCHELLE, STEVE, PABLO, BRUCE) |
BRUCE | TECHPUBS | WRITERS
(ignored, see note 2) |
TECHPUBS.
TABLE4 |
TECHPUBS | Users with TECHPUBS as SecondaryID (ROCHELLE, STEVE, PABLO, BRUCE) |
Table Notes
As shown in the above table, the AuthID portion of the name assigned to a database object when it is created, and the users who have access to that object depend on how AuthIDs, GroupIDs and SecondaryIDs are defined. The object naming and usage rules are as follows:
For example, if user david (who is in the writers group) creates a table called staff in the location called books, the table's three-part name would be books.david.staff. If user arlene (who is also assigned to the writers group) attempts to create a table called staff, in the location called books, the table's three-part name would be books.arlene.staff. Since the three-part names of the two tables are unique, each user can have a table of the same one-part name within a location.
For example, if user rochelle (who has a SecondaryID of techpubs) creates a table called staff in the location called books, the table's three-part name would be books.techpubs.staff. If user steve (who also has techpubs as his SecondaryID) attempts to create a table called staff, the table's three-part name would also be books.techpubs.staff. This is not allowed.
Users rochelle, steve, pablo, and bruce all have all privileges on techpubs.table1, techpubs.table2, techpubs.table3, and techpubs.table4. GRANT and REVOKE commands for these users and tables will have no effect.
If an object has a different owner, then granting privileges to the SecondaryID will give those privileges to all users who have that SecondaryID as their Current SQLIDs.