Previous Topic: Deleting a RestrictionNext Topic: Condition/Restriction Reporting (DQCRRPT)


Sample Condition and Restriction

The following is a step-by-step example of how to create a restricted condition using the Sample Order Entry Database.

Assume that your company has sales offices in New York, San Francisco, Dallas, and Atlanta. In each sales office is an accounting department. The accounting department in Dallas does not need to access data for any state except Texas from the CA-CUST-REC table. To restrict the CPAs in the Dallas sales office to records from the CA-CUST-REC table with STATE=TX, perform the following steps:

Step 1

Assign these group levels to all CPAs in Dallas using the USERS option on the Administrative Menu:

Sample User File (Table) Maintenance (DQKN0)

 =>  Enter the user information and press the appropriate PF key  --------------------------------------------------------------------------DQKN0  DATAQUERY:  USER FILE MAINTENANCE  -------------------------------------------------------------------------------   USER NAME           : DALCPA1   PASSWORD            :                           OPTIONAL   ACCOUNTING CODE     :                           OPTIONAL   QUERY LANGUAGE      :  DQL                      SQL OR DQL   SQL AUTHORIZATION ID:                           REQUIRED FOR SQL OR PDB   GROUP LEVEL 1       :  SALES                    OPTIONAL   GROUP LEVEL 2       :  DALLAS                   IF USED, LEVEL 1 REQUIRED   GROUP LEVEL 3       :  ACCOUNTING               IF USED, LEVEL 2 REQUIRED  DQ SYSTEM STATUS.   DATA AUTHORIZED     :    ASSOCIATE USER       :    PERSONAL DATABASE      :   SUBMIT ALLOWED      :    EXPORT ALLOWED       :    EMAIL ALLOWED          :   SQL AND DQL ALLOWED :    SQL DATA DEF ALLOWED :    SQL DATA MAINT ALLOWED :  SYSTEM ADMINISTRATIVE MENU ITEMS AUTHORIZED FOR.   CONDITIONS          :    RESTRICTIONS         :    PRINTER CONTROL        :   JCL MAINTENANCE     :    DIAGNOSTICS          :    LANGUAGE               :   USER MAINTENANCE    :    FOUND SET MAINT      :    QUERY LIBRARY MAINT    :   SECURITY            :  -------------------------------------------------------------------------------  <PF1> HELP      <PF2> RETURN       <PF3> ADD          <PF4> OVERRIDE DEFAULTS

Step 2

Create a condition using the CONDITIONS option on the Administrative Menu for the CA-CUST-REC table which states:

WITH STATE = 'TX'

Sample Condition

 =>  CREATION PANEL  --------------------------------------------------------------------------DQD10  DATAQUERY:  EDITOR            CURRENT TABLE:  CA-CUST-REC____________________  -------------------------------------------------------------------------------  NAME:          CPA-COND_______                   TYPE: COND__                _  DESCRIPTION:   ___________________________________________________________     ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.  .. ================================ T O P =====================================  .. WITH STATE = 'TX'  ..  ..  ..  ..  ..  ..  ..  ..  ..     ===========================  B O T T O M  ==================================  -------------------------------------------------------------------------------  <PF1> HELP          <PF2>  RETURN     <PF3>  DISPLAY FIELDS <PF4>  DISPLAY KEYS  <PF5> DISPLAY ALL   <PF6>  LIST TABLES<PF7>  BACKWARD       <PF8>  FORWARD  <PF9> TEMPLATE      <PF10> VALIDATE   <PF11> RIGHT/LEFT     <PF12> PROCESS MODE

Step 3

Create a restriction for the CA-CUST-REC table specifying the groups as SALES, DALLAS, and ACCOUNTING and listing the condition created in Step 2 named CPA-COND. Press <PF4> SAVE to save the restriction.

Sample Restriction

 =>  OVERTYPE THE CONDITIONS TO BE MODIFIED AND PRESS <PF4> TO COMPLETE THE UPDATE  --------------------------------------------------------------------------DQKA0  DATAQUERY:  RESTRICTION EDIT  -------------------------------------------------------------------------------  OPERATOR      ________________________________  GROUP ID: LV1 SALES__________  LV2 DALLAS_________  LV3 ACCOUNTING_____  TABLE:        CA-CUST-REC____________________  -------------------------------------------------------------------------------  CONDITIONS:      CPA-COND_______  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________      _______________  _______________  _______________  _______________  -------------------------------------------------------------------------------  <PF1>  HELP       <PF2>  RETURN   <PF3> DISPLAY CONDITION <PF4>  SAVE  <PF5>  LIST CONDS <PF6>  DELETE   <PF7> NOT USED          <PF8>  NOT USED

You have now successfully restricted access to data in the CA-CUST-REC table. Users whose group assignments match these are restricted using the CPA-COND condition when they try to access the CA-CUST-REC table. An additional selection criteria, WITH STATE = 'TX' has been added to any qualifying criteria which the user presents to access this table.