Skip to main content

skip to main content

developerWorks  >  Information Management  >

Understanding the SB+ Security API

Maintain SB+ security for U2 servers without using the security screens

developerWorks
Document options

Document options requiring JavaScript are not displayed


Rate this page

Help us improve this content


Level: Intermediate

Ehab AbuShmais (ehaba@us.ibm.com), Advanced Technical Services Engineer, IBM

29 Mar 2007

In the past, accessing U2 SB+ for UniData and UniVerse security from outside of SB+ security screens was difficult. But now, you can use a new function, SH.SEC.API, to talk to SB+ security using routine calls when outside of SB+ security screens and reports. SB+ Release 5.4.0 makes it significantly easier for the system administrator to maintain SB+ security. This article teaches you how to implement this API and includes detailed programming examples.

Introduction

SB+, IBM® SystemBuilder, is a cross-platform, complete and powerful rapid application development and deployment environment that enables developers to focus on what they know best: their application, their business and their users. SB+ lets you quickly design IBM U2 data server structures and develop applications using a comprehensive developer interface. And, you there's no need to handwrite code.

SB+ provides a comprehensive security system. Within the SB+ security system, you can define users and groups of users within a hierarchy of parent-child relationships while logged onto SB+ but only using SB+ security screens. Any attempt to amend or create SB+ user or group security records outside of SB+ configuration screens results in security violation and security record corruption. However, SB+ Version 5.4.0 implements a security API for applications developed in SB+. This API integrates the settings in the application with SB+ user and group security, thus enabling users with appropriate permissions to update SB+ user and group security records from outside of SB+ configuration screens.

This article teaches you how to use the SH.SEC.API function to access, control and manage SB+ security when outside of SB+ security setup screens and reports using BASIC programs. As of version 5.4.1 of SB+, there are 12 available options that can be passed through PARAM (in other words, the subroutine call includes 12 options), as described in Table 1 below.

This capability does require:

  1. The user initiating this program be in the SB+ ROOT group
  2. A control flag be set to 1 for the subroutine to take the effect: SB.CONTROL <15,16>
    To set this flag, edit the DMCONT file and the SB.CONTROL record, or set the value equal to 1 through a BASIC program.

    Note: If this flag is not set the user subroutine will not be invoked.

Additional notes:

  1. When executing this routine, an SB+ message is sent to all the other ROOT group members informing them of this. This message contains details about the subroutine: which user ran the security API, as well as the date and time it was run, and from what IP address.
  2. Changes through this function are tracked by Sarbanes Oxley Reports (SOX).
  3. To adhere to SB+ standard conventions, you should use uppercase user and group IDs when creating new ones. The developer is responsible for this validation as well as any information that goes into the record.
  4. When running any SH.SEC.API parameters in a program to amend security, the API respects record locking. This means the record cannot be opened in SB+ security setup screens while the API program is trying to amend the same record. In this case, a record locked message is displayed.

Examples of the available API options

PARAM 1: Create a new user record in SB+ security

The following BASIC program uses the SH.SEC.API to create a new userid in SB+ based on a record from another file. The idea is to collect all the relevant information to create a new SB+ userid, using a customized interface, and store it on a file that this program can access. To help you build a customized interface, we provide you with the user record definition layout that SB+ expects. As a developer you are responsible for all field validation within your customized user and group security screen. For your convenience, the complete user definition layout is included at the end of this document. The requirements for creating a new user record using SH.SEC.API are provided in Table 2: User Definitions Record Layout.

The following attributes are the minimum requirements for creating a new user record: 1-5, 10, 15, 16, 21, 27 (including all multi-values), and 28

The following steps are necessary to successfully test the following example:

  1. Create a file and call it SEC.FILE.
  2. Copy DMSECURITY "~SB" for the TO: prompt type (SEC.FILE BASE) and press Enter.
  3. Amend the record BASE by changing line 4, "password", to XXXX.
  4. Run the program example below.

The program example will create a new user called "NEWUSER" based on the record BASE from the file SEC.FILE with password XXXX. The password will be changed and encrypted after first logon with this userid. The user will be prompted to change the password from XXXX to a new password.


Program example 1
				
$INCLUDE DMSKELCODE COMMON                                   
$INCLUDE DMSKELCODE STANDARD.EQU                             
OPEN "SEC.FILE" TO MYFILE ELSE STOP                                    
READ RECORD FROM MYFILE,"BASE" ELSE RECORD = ""                  
VALUE = "~NEWUSER"                                                
PARAM = 1                                                         
CALL SH.SEC.API

PARAM 2: Amend an existing user record in SB+ security

Note: The user record must exist and must have no null flags. Validation will fail and you will not be able to amend an existing user record if any of the user flags are not set.


Program example 2
				
$INCLUDE DMSKELCODE COMMON                        
$INCLUDE DMSKELCODE STANDARD.EQU                  
*                                                 
READ RECORD FROM F.PASS,"~NEWUSER" ELSE RECORD ="" 
RECORD<3> = "FIRSTNAME"                           
PARAM = 2                                         
CALL SH.SEC.API  

PARAM 3: Delete a user record from SB+ security


Program example 3
				
$INCLUDE DMSKELCODE COMMON        
$INCLUDE DMSKELCODE STANDARD.EQU  
VALUE = "~NEWUSER"                     
PARAM = 3                              
CALL SH.SEC.API                        

PARAM 11: Create a new SB+ group record

The minimum requirement for creating a new SB+ group is a record with the first three attributes from Table 3: Group Definitions Record Layout at the end of this document.

  1. Type = "G"
  2. Description
  3. Parent Group Code

Program example 4
				
$INCLUDE DMSKELCODE COMMON                      
$INCLUDE DMSKELCODE STANDARD.EQU                
OPEN "SEC.FILE" TO MYFILE ELSE STOP             
READ RECORD FROM MYFILE,"BASEG" ELSE RECORD = ""
KEY = "NEWGROUP"                             
PARAM = 11                                     
CALL SH.SEC.API

PARAM 12: Amend an existing SB+ group record


Program example 5
				
$INCLUDE DMSKELCODE COMMON                        
$INCLUDE DMSKELCODE STANDARD.EQU
READ RECORD FROM F.PASS, "NEWGRP" ELSE RECORD = ""
RECORD<2> = "NEW DESCRIPTION"                     
PARAM = 12                                        
CALL SH.SEC.API                                   

PARAM 13: Delete an existing group record


Program example 6
				
$INCLUDE DMSKELCODE COMMON                          
$INCLUDE DMSKELCODE STANDARD.EQU                    
KEY = "NEWGRP"                                      
PARAM = 13                                          
CALL SH.SEC.API                                     

PARAM 15: Retrieve all restricted account access for a group


Program example 7
				
$INCLUDE DMSKELCODE COMMON                      
$INCLUDE DMSKELCODE STANDARD.EQU 
KEY = "ROOT"                 
PARAM = 15                   
CALL SH.SEC.API               
CRT "VALUE IS:  ":VALUE         

PARAM 16: Retrieve all unrestricted account access for a group


Program example 8
				
$INCLUDE DMSKELCODE COMMON                      
$INCLUDE DMSKELCODE STANDARD.EQU      
KEY = "ROOT"                 
PARAM = 16                  
CALL SH.SEC.API               
CRT "VALUE IS:  ":VALUE

PARAM 17: Retrieve allowed processes


Program example 9
				
$INCLUDE DMSKELCODE COMMON                      
$INCLUDE DMSKELCODE STANDARD.EQU    
KEY = "ROOT"                 
PARAM = 17                  
CALL SH.SEC.API               
CRT "VALUE IS:  ":VALUE

PARAM18: Retrieve disallowed processes


Program example 10
				
$INCLUDE DMSKELCODE COMMON                      
$INCLUDE DMSKELCODE STANDARD.EQU     
KEY = "ROOT"                 
PARAM = 18                    
CALL SH.SEC.API               
CRT "VALUE IS: ":VALUE

PARAM 19: Retrieve allowed menu options


Program example 11
				
$INCLUDE DMSKELCODE COMMON                      
$INCLUDE DMSKELCODE STANDARD.EQU      
KEY = "ROOT"                 
PARAM = 19                    
CALL SH.SEC.API               
CRT "VALUE IS: ":VALUE

PARAM 20: Retrieve disallowed menu options


Program example 12
				
$INCLUDE DMSKELCODE COMMON                      
$INCLUDE DMSKELCODE STANDARD.EQU    
KEY = "ROOT"                 
PARAM = 20                    
CALL SH.SEC.API               
CRT "VALUE IS: ":VALUE


Table 1. The 12 available options for SH.SEC.API

OptionPARAMFunction
11Create user record
22Amend user record
33Delete user record
-4-10Reserved
411Create group record
512Amend group record
613Delete group record
715Retrieve all restricted account access for a group
816Retrieve all unrestricted account access for a group
917Retrieve allowed processes
1018Retrieve disallowed processes
1119Retrieve allowed menu options
1220Retrieve disallowed menu options

Table 2. User Definitions Record Layout
AMC.VMCDescription
1Type = "U"
2Surname
3First Name
4Password (Encrypted)
5Group Code (4 Alpha)
10User Status Code (Active,Logged,Misc,Resigned, Network,Developer)
15Keyboard Lock (Mins)
16User defined Macro Lead-in Character
21Nick-Name for Office use, friendlier status
27.MCFlags for user key insertion
27.1Full Refresh Of Whole Screen (N/Y)
27.2Auto Help Display (N/Y/M/A)
27.3Suppress Confirm On Screen Esc (N/Y)
27.4Command Stack Per Account (N/Y)
27.5Suppress Beep On Error (N/Y)
27.6Auto Extend Field Length (N/Y/D)
27.7Suppress Logon Message Delay (N/Y/M/A)
27.8Show errors in dialog box (N/Y/)
27.9Main Heading Justification (C=0/L=1/R=2)
27.10GUI User preferences - Add Fkey ref. to buttons
27.11Center all screens
27.12Center all menus (1,3,4)
27.13Center/position help
27.14Center/position lookups
27.15Generate GUI screen code - not used
27.16Grey Out Disabled Forms
27.17Deselect before Int. Help
27.18ECLType 'U' (N/Y)
27.19Disable 1st Level Help (use HELP_STRING)
27.20Suppress E19 (derived fld/conv) in FD tool (N/Y)
27.21Use "sbplistlistviewclass" for GUI Selects
27.22GUI User preferences - Menu Navigation Method
27.23Self-Contained Forms Flag
27.24Disable SBClient Tooltips
27.25Use Windows Edit Menu (GUI Click)
27.26Language Code
27.27Temporary Quiet Mode Flag
27.28Date format - International or American
27.29New password next login (N/Y)
27.30Autologin Flag (0,1,2)
28.MDFlags in attribute 27 converted (N=0,Y=1,D=2,M=2,A=3)
CodeDescription
MMulti-Value
CControlling Field
DDependent Field
WWork Field

Table 3. Group Definitions Record Layout
AMC.VMCDescription
0Group Code (Alpha)
1Type = "G"
2Description
3Parent Group Code
4.MCChild Group Codes
5.MCAccounts Un-Restricted List
6.MCRestricted Accounts List
7Inhibit Break Key (Y/N)
8Inhibit Supervisor (Y/N)
9Inhibit Process From Inputs (N/C/A)
10Inhibit TCL (Y/N)
11Keyboard Lock Upper Limit (Mins)
12.1Allow or Disallow Verbs list (A/D)
12.MCRestricted Verbs
13.MCValid Report Locations
14.MCUsers of this Group
15.MCActive Dates OR Days (Start Date or Day of Week)
16.MDActive Dates OR Days (Upto Date or Day of Week)
17.MDActive Logon From Times
18.MDActive Logon Upto Times
19Password Rollover Date Expression
20Check-Sum
21.MCLast Maintained by
22.MDLast Maintained Date
23W<12.M> (Y/N)
25.MWUnrestricted Accounts up Tree
26.MWRestricted Accounts up Tree
27.MWRestricted Verbs Up Tree
28.MWRestricted Files Up Tree
29.MGroup Printer Defaults
30.MGroup Aux Print Defaults
CodeDescription
MMulti-Value
CControlling Field
DDependent Field
WWork Field

Conclusion

Hopefully, this article enables you to take full advantage of the new SB+ security API. It provided an explanation of the new feature, descriptions of the 12 options within the feature, and examples for each. You've gained knowledge about the background of the SB+ Security API and its power to give you, as a developer, the ability to customize your own security front end to communicate with SB+ security. Now, you know how to enable the SB+ Security API in your environment and how to deploy each of the security API's option.



Resources

Learn

Get products and technologies
  • Download IBM product evaluation versions and get your hands on application development tools and middleware products from DB2®, Lotus®, Rational®, Tivoli®, and WebSphere®.

  • Build your next development project with IBM trial software, available for download directly from developerWorks.

Discuss


About the author

Author photo

Ehab AbuShmais is an SB+ software engineer with 11 years of experience in SB+ products support, engineering, and consulting. Ehab is the author of the book Building Applications Using IBM SB+ GUI. Ehab has a Bachelor of Science in Information Systems Engineering from Southern Polytechnic State University, and a Master of Science in Computer Information Systems from University of Denver.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top