20 Role Opcode Workflows

Learn about the Oracle Communications Billing and Revenue Management (BRM) role opcode workflows.

Topics in this document:

Opcodes Described in This Chapter

Table 20-1 lists the opcodes described in this chapter.

Caution:

  • Always use the BRM API to manipulate data. Changing data in the database without using the API can corrupt the data.

  • Do not use SQL commands to change data in the database. Always use the API.

Table 20-1 Opcodes Described in This Chapter

Opcode Topic

PCM_OP_CUST_CREATE_ROLE

Creating a Role

PCM_OP_CUST_UPDATE_ROLE

Modifying a Role

PCM_OP_CUST_DELETE_ROLE

Deleting a Role

PCM_OP_CUST_ASSOCIATE_ROLE

Associating a pcm_client or admin_client Service with a Role

For information about default users created during installation and their associated roles, see "Default users" in System Administrator's Guide. For information about the default roles that are created, see "Custom Users" in System Administrator's Guide.

Creating a Role

Use the PCM_OP_CUST_CREATE_ROLE opcode to create roles, defining the opcodes that can be run and the storable classes that can be read or updated by users with that role. This opcode must be run by a user with the SuperUserRole role. This opcode creates a /config/role object.

You create a role by including the following in the input flist:

  • The name (PIN_FLD_NAME) and description (PIN_FLD_DESCR) of the new role and other identifying parameters.

  • A PIN_FLD_PERMITTEDS element containing a list of either FM (PIN_FLD_FM_OPCODES) or base (PIN_FLD_BASE_OPCODES) opcodes that can be performed by the role. Do not include both.

  • If you have included PCM_OP_EXEC_SPROC in PIN_FLD_BASE_OPCODES, you should provide a list of stored procedures that can be run by the role in PIN_FLD_CLASSES.

  • For any other entry in PIN_FLD_BASE_OPCODES, you should provide a list of classes that can be modified by the role in PIN_FLD_CLASSES.

The PCM_OP_CUST_CREATE_ROLE opcode does the following:

  1. Validates the mandatory parameters in the input flist.

  2. Validates that either PIN_FLD_FM_OPCODES or PIN_FLD_BASE_OPCODES are present but not both (or if both are provided, that one is empty).

  3. Validates that if the PIN_FLD_BASE_OPCODES field is populated, PIN_FLD_CLASSES is also provided and not empty.

  4. Validates that none of the entries duplicate each other.

  5. Creates a /config/role object with the supplied information.

Following is a sample input flist for the PCM_OP_CUST_CREATE_ROLE opcode. The sample below allows users with the testnap_role role to run the following:

  • FM opcodes: Users can run the PCM_OP_CUST_CREATE_CUSTOMER and PCM_OP_BILL_MAKE_BILL opcodes, and any opcodes that start with "PCM_OP_BAL."
  • Policy opcodes: Users can run PCM_OP_BAL_POL_VAL_BAL_TRANSFER as an entry level opcode because PIN_FLD_FM_OPCODES allows opcodes that start with "PCM_OP_BAL." It could also be allowed by including PCM_OP_BAL_POL_VAL_BAL_TRANSFER in PIN_FLD_FM_OPCODES directly.
  • Base opcodes: Users can run the PCM_OP_WRITE_FLDS, PCM_OP_READ_FLDS, and PCM_OP_CREATE_OBJ opcodes on /account and /bill class objects and /service and its child class objects.
0 PIN_FLD_POID                  POID [0] 0.0.0.1 /config/role -1 0
0 PIN_FLD_ACCOUNT_OBJ           POID [0] 0.0.0.1 /account 123456 0
0 PIN_FLD_DESCR                 STR [0] "Permissions for testnap"
0 PIN_FLD_HOSTNAME              STR [0] "-"
0 PIN_FLD_NAME                  STR [0] "testnap role"
0 PIN_FLD_PROGRAM_NAME          STR [0] "testnap"
0 PIN_FLD_PERMITTEDS    ARRAY [0] allocated 20, used 2
1     PIN_FLD_FM_OPCODES        STR [0] "PCM_OP_CUST_CREATE_CUSTOMER, PCM_OP_BILL_MAKE_BILL, PCM_OP_BAL_*"
1      PIN_FLD_BASE_OPCODES        STR [0] ""
1     PIN_FLD_CLASSES             STR [0] ""
0 PIN_FLD_PERMITTEDS    ARRAY [1] allocated 20, used 2
1     PIN_FLD_FM_OPCODES        STR [0] ""
1      PIN_FLD_BASE_OPCODE        STR [0] "PCM_OP_WRITE_FLDS"
1     PIN_FLD_CLASSES             STR [0] "/account,/bill,/service/*"
0 PIN_FLD_PERMITTEDS    ARRAY [2] allocated 20, used 2
1     PIN_FLD_FM_OPCODES        STR [0] ""
1      PIN_FLD_BASE_OPCODE        STR [0] "PCM_OP_READ_FLDS,PCM_OP_CREATE_OBJ"
1     PIN_FLD_CLASSES             STR [0] "/account,/bill,/service/*"

Following is the output flist for the PCM_OP_CUST_CREATE_ROLE opcode, containing the POID of the new /config/role object:

0 PIN_FLD_POID                  POID [0] 0.0.0.1 /config/role 234567 0

Modifying a Role

Use the PCM_OP_CUST_UPDATE_ROLE opcode to modify roles, adding opcodes that can be run and storable classes that can be read or updated by users with that role. This opcode must be run by a user with the SuperUserRole role. This opcode modifies a /config/role object.

You add opcodes and storable classes to a role by including the following in the input flist:

  • The POID of the /config/role object.

  • A PIN_FLD_PERMITTEDS element containing a list of either FM (PIN_FLD_FM_OPCODES) or base (PIN_FLD_BASE_OPCODES) opcodes that can be performed by the role. Do not include both.

  • If you have included PCM_OP_EXEC_SPROC in PIN_FLD_BASE_OPCODES, you should provide a list of stored procedures that can be run by the role in PIN_FLD_CLASSES.

  • For any other entry in PIN_FLD_BASE_OPCODES, you should provide a list of classes that can be modified by the role in PIN_FLD_CLASSES.

The PCM_OP_CUST_UPDATE_ROLE opcode does the following:

  1. Validates the mandatory parameters in the input flist.

  2. Validates that if the PIN_FLD_BASE_OPCODES field is populated, PIN_FLD_CLASSES is also provided and not empty.

  3. Validates that none of the entries duplicate each other or entries already contained in the role.

  4. Updates the /config/role object with the supplied information. If an element (for example, PIN_FLD_FM_OPCODES) already exists on the object, the new entries will be appended to it. If the element does not exist, it will be added.

Following is a sample input flist for the PCM_OP_CUST_UPDATE_ROLE opcode. The sample below adds permissions for users with the testnap_role role to run the following:

  • Base opcodes: Users can run the PCM_OP_WRITE_FLDS, PCM_OP_CREATE_OBJ, and PCM_OP_READ_FLDS opcodes on /balance_group and PCM_OP_READ_FLDS on /group/sharing in addition to whatever was defined for the role before.
0 PIN_FLD_POID                  POID [0] 0.0.0.1 /config/role 234567 0
0 PIN_FLD_PERMITTEDS    ARRAY [1] allocated 20, used 2
1     PIN_FLD_FM_OPCODES        STR [0] ""
1      PIN_FLD_BASE_OPCODE        STR [0] "PCM_OP_WRITE_FLDS,PCM_OP_CREATE_OBJ"
1     PIN_FLD_CLASSES             STR [0] "/balance_group"
0 PIN_FLD_PERMITTEDS    ARRAY [2] allocated 20, used 2
1     PIN_FLD_FM_OPCODES        STR [0] ""
1      PIN_FLD_BASE_OPCODE        STR [0] "PCM_OP_READ_FLDS"
1     PIN_FLD_CLASSES             STR [0] "/balance_group,/group/sharing"

Following is the output flist for the PCM_OP_CUST_UPDATE_ROLE opcode, containing the POID of the modified /config/role object:

0 PIN_FLD_POID                  POID [0] 0.0.0.1 /config/role 234567 0

Deleting a Role

Use the PCM_OP_CUST_DELETE_ROLE opcode to delete a role. This opcode deletes a /config/role object.

You delete a role by including the following in the input flist:

  • The POID of the /config/role object.

The PCM_OP_CUST_DELETE_ROLE opcode does the following:

  1. Validates the mandatory parameters in the input flist.

  2. Deletes the /config/role object.

Following is a sample input flist for the PCM_OP_CUST_DELETE_ROLE opcode. The sample below deletes the role with the POID 234567:

0 PIN_FLD_POID                  POID [0] 0.0.0.1 /config/role 234567 0

Following is the output flist for the PCM_OP_CUST_DELETE_ROLE opcode, containing the POID of the deleted /config/role object:

0 PIN_FLD_POID                  POID [0] 0.0.0.1 /config/role 234567 0

Associating a pcm_client or admin_client Service with a Role

Use the PCM_OP_CUST_ASSOCIATE_ROLE opcode to associate a pcm_client or admin_client service with an existing role. This opcode updates a /service/pcm_client or /service/admin_client object.

You associate a pcm_client or admin_client service with a role by including the following in the input flist:

  • The POID of the pcm_client or admin_client service.

  • The role that is being associated with the service (PIN_FLD_CONFIG_PROFILE_OBJ).

The PCM_OP_CUST_ASSOCIATE_ROLE opcode does the following:

  1. Validates the mandatory parameters in the input flist.

  2. Validates that the service is a .pcm_client or admin_client service.

  3. Validates that the provided role exists.

  4. Adds the role to the service in the PIN_FLD_CONFIG_ROLE element.

Following is a sample input flist for the PCM_OP_CUST_ASSOCIATE_ROLE opcode. The sample below associates the role with the POID 234567 with a pcm_client service:

0 PIN_FLD_POID                      POID [0] 0.0.0.1 /service/pcm_client 123456 5
0 PIN_FLD_CONFIG_ROLE                    SUBSTRUCT [0] allocated 3, used 1
1     PIN_FLD_CONFIG_PROFILE_OBJ    POID [0] 0.0.0.1 /config/role 234567 0

Following is the output flist for the PCM_OP_CUST_ASSOCIATE_ROLE opcode, containing the POID of the modified /service/pcm_client object:

0 PIN_FLD_POID                      POID [0] 0.0.0.1 /service/pcm_client 123456 5