index

Package gb_bus_prof_rule

This package provides the Common Business interface for the BUSINESS PROFILE RULE API, gb_bus_prof_rule.
 
This supports the FGAC Business Profile Access to Predicate Rules Table (GORFGBP).
The FGAC Business Profile Rules assign the categories of users and their privileges (Select, Insert, Update, Delete) to each domain and predicate for a FGAC VBS Group Rule.  Business Profiles provide a convenient way to categorize multiple users who share the same security access privileges and restrictions that should be enforced with FGAC processing.
Users assigned to a business profile automatically inherit the characteristics and predicates of the profile.  The same business profile may be assigned to multiple predicate rules within the same Group Rule.  If a user is assigned to a business profile with access restrictions it is not necessary to have user-specific access restrictions for the same predicate rule for the FGAC Rule Group.
 
If a user is associated with multiple business profiles that have different access privileges for the same domain and predicate rule within an FGAC Rule Group, the restrictions associated with any one of the business profiles will always be applied in FGAC processing.  For example, a user's insert privilege restricted by FGAC processing if they are associated with one business profile that has insert restrictions, even if that user is also associated with a second business profile that does not have insert restrictions.


Program units
f_api_version   Returns the API version number.
f_exists   Checks to see if a record exists.
f_isequal   Compares two records for equality.
f_query_all   Selects all records for the entity.
f_query_one   Selects one record using the key.
f_query_by_rowid   Selects one record using the ROWID.
f_query_one_lock   Selects one record and locks it.
p_create   Creates a record.
p_delete   Deletes a record.
p_lock   Locks a record.
p_update   Updates a record.

Types
bus_prof_rule_rec   Entity record type.
bus_prof_rule_ref   Entity cursor variable type.
bus_prof_rule_tab   Entity table type.

Constants
M_ENTITY_NAME   Business Entity name.


M_ENTITY_NAME

M_ENTITY_NAME    CONSTANT VARCHAR2(13) := 'BUS_PROF_RULE';

Business Entity name.


bus_prof_rule_rec

TYPE bus_prof_rule_rec IS RECORD (
   r_fgac_code               gorfgbp.gorfgbp_fgac_code%TYPE,
   r_fdmn_code               gorfgbp.gorfgbp_fdmn_code%TYPE,
   r_fprd_seqno              gorfgbp.gorfgbp_fprd_seqno%TYPE,
   r_fbpr_code               gorfgbp.gorfgbp_fbpr_code%TYPE,
   r_select_ind              gorfgbp.gorfgbp_select_ind%TYPE,
   r_insert_ind              gorfgbp.gorfgbp_insert_ind%TYPE,
   r_update_ind              gorfgbp.gorfgbp_update_ind%TYPE,
   r_delete_ind              gorfgbp.gorfgbp_delete_ind%TYPE,
   r_user_id                 gorfgbp.gorfgbp_user_id%TYPE,
   r_internal_record_id      gb_common.internal_record_id_type);

Entity record type.


bus_prof_rule_ref

TYPE bus_prof_rule_ref IS REF CURSOR RETURN bus_prof_rule_rec;

Entity cursor variable type.


bus_prof_rule_tab

TYPE bus_prof_rule_tab IS TABLE OF bus_prof_rule_rec INDEX BY BINARY_INTEGER;

Entity table type.


f_api_version

FUNCTION f_api_version RETURN PLS_INTEGER

Returns the API version number.

Returns
Version of the API signature. Changes only when the signature changes.


f_exists

FUNCTION f_exists(p_fgac_code  gorfgbp.gorfgbp_fgac_code%TYPE,
                  p_fdmn_code  gorfgbp.gorfgbp_fdmn_code%TYPE,
                  p_fprd_seqno gorfgbp.gorfgbp_fprd_seqno%TYPE,
                  p_fbpr_code  gorfgbp.gorfgbp_fbpr_code%TYPE DEFAULT NULL,
                  p_rowid      VARCHAR2 DEFAULT NULL) RETURN VARCHAR2

Checks to see if a record exists.

Parameters
p_fgac_code   FGAC group code. VARCHAR2(30) Required Key.
p_fdmn_code   FGAC domain code. VARCHAR2(30) Required Key.
p_fprd_seqno   One up number per predicate and domain to allow multiple predicates per domain. NUMBER(4) Required Key.
p_fbpr_code   FGAC business profile code.  VARCHAR2(30) Required Key.

Returns
Y if found, otherwise N.


f_isequal

FUNCTION f_isequal(rec_one bus_prof_rule_rec,
                   rec_two bus_prof_rule_rec) RETURN VARCHAR2

Compares two records for equality.
Tests each field of rec_one against the corresponding field of rec_two.
Two null values are considered equal.

Parameters
rec_one   The first record to compare. Type bus_prof_rule_rec Required.
rec_two   The second record to compare. Type bus_prof_rule_rec Required.

Returns
Y if all values in records are equal, otherwise N. Nulls match Nulls.


f_query_all

FUNCTION f_query_all(p_fgac_code  gorfgbp.gorfgbp_fgac_code%TYPE,
                     p_fdmn_code  gorfgbp.gorfgbp_fdmn_code%TYPE,
                     p_fprd_seqno gorfgbp.gorfgbp_fprd_seqno%TYPE,
                     p_fbpr_code  gorfgbp.gorfgbp_fbpr_code%TYPE DEFAULT NULL)
  RETURN bus_prof_rule_ref

Selects all records for the entity.

Parameters
p_fgac_code   FGAC group code. VARCHAR2(30) Required Key.
p_fdmn_code   FGAC domain code. VARCHAR2(30) Required Key.
p_fprd_seqno   One up number per predicate and domain to allow multiple predicates per domain. NUMBER(4) Required Key.
p_fbpr_code   FGAC business profile code.  VARCHAR2(30) Optional.

Returns
A cursor variable that will fetch the set of records.


f_query_one

FUNCTION f_query_one(p_fgac_code  gorfgbp.gorfgbp_fgac_code%TYPE,
                     p_fdmn_code  gorfgbp.gorfgbp_fdmn_code%TYPE,
                     p_fprd_seqno gorfgbp.gorfgbp_fprd_seqno%TYPE,
                     p_fbpr_code  gorfgbp.gorfgbp_fbpr_code%TYPE)
  RETURN bus_prof_rule_ref

Selects one record using the key.

Parameters
p_fgac_code   FGAC group code. VARCHAR2(30) Required Key.
p_fdmn_code   FGAC domain code. VARCHAR2(30) Required Key.
p_fprd_seqno   One-up number per predicate and domain combination to allow multiple predicates per domain. NUMBER(4) Required Key.
p_fbpr_code   FGAC business profile code. VARCHAR2(30) Required Key.

Returns
A cursor variable that will fetch exactly one record.


f_query_by_rowid

FUNCTION f_query_by_rowid(p_rowid VARCHAR2) RETURN bus_prof_rule_ref

Selects one record using the ROWID.

Parameters
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18) Required Key.

Returns
A cursor variable that will fetch exactly one record.


f_query_one_lock

FUNCTION f_query_one_lock(p_fgac_code  gorfgbp.gorfgbp_fgac_code%TYPE,
                          p_fdmn_code  gorfgbp.gorfgbp_fdmn_code%TYPE,
                          p_fprd_seqno gorfgbp.gorfgbp_fprd_seqno%TYPE,
                          p_fbpr_code  gorfgbp.gorfgbp_fbpr_code%TYPE,
                          p_rowid      VARCHAR2 DEFAULT NULL)
  RETURN bus_prof_rule_ref

Selects one record and locks it.

Parameters
p_fgac_code   FGAC group code. VARCHAR2(30) Required Key.
p_fdmn_code   FGAC domain code. VARCHAR2(30) Required Key.
p_fprd_seqno   One-up number per predicate and domain combination to allow multiple predicates per domain. NUMBER(4) Required Key.
p_fbpr_code   FGAC business profile code. VARCHAR2(30) Required Key.
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18) Optional.

Returns
A cursor variable for one record, locking the record.


p_create

PROCEDURE p_create(p_fgac_code  gorfgbp.gorfgbp_fgac_code%TYPE,
                   p_fdmn_code  gorfgbp.gorfgbp_fdmn_code%TYPE,
                   p_fprd_seqno gorfgbp.gorfgbp_fprd_seqno%TYPE,
                   p_fbpr_code  gorfgbp.gorfgbp_fbpr_code%TYPE,
                   p_select_ind gorfgbp.gorfgbp_select_ind%TYPE DEFAULT 'N',
                   p_insert_ind gorfgbp.gorfgbp_insert_ind%TYPE DEFAULT 'N',
                   p_update_ind gorfgbp.gorfgbp_update_ind%TYPE DEFAULT 'N',
                   p_delete_ind gorfgbp.gorfgbp_delete_ind%TYPE DEFAULT 'N',
                   p_user_id    gorfgbp.gorfgbp_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_rowid_out  OUT VARCHAR2)

Creates a record.
Enter the required keys to assign the categories of users and their privileges (Select, Insert, Update, Delete) to each domain and predicate for a FGAC VBS Group Rule.

Parameters
p_fgac_code   FGAC group code. VARCHAR2(30) Required Key.
p_fdmn_code   FGAC domain code. VARCHAR2(30) Required Key.
p_fprd_seqno   One-up number per predicate and domain combination to allow multiple predicates per domain. NUMBER(4) Required Key.
p_fbpr_code   FGAC business profile code. VARCHAR2(30) Required Key.
p_select_ind   Indicates if the business profile is for select access. VARCHAR2(1) Optional.
p_insert_ind   Indicates if the business profile is for insert access. VARCHAR2(1) Optional.
p_update_ind   Indicates if the business profile is for update access. VARCHAR2(1) Optional.
p_delete_ind   Indicates if the business profile is for delete access. VARCHAR2(1) Optional.
p_user_id   The Oracle ID of the user who created or last updated the record. VARCHAR2(30) Optional.
p_rowid_out   Database ROWID of the record being created. VARCHAR2(18) Required.


p_delete

PROCEDURE p_delete(p_fgac_code  gorfgbp.gorfgbp_fgac_code%TYPE,
                   p_fdmn_code  gorfgbp.gorfgbp_fdmn_code%TYPE,
                   p_fprd_seqno gorfgbp.gorfgbp_fprd_seqno%TYPE,
                   p_fbpr_code  gorfgbp.gorfgbp_fbpr_code%TYPE,
                   p_rowid      VARCHAR2 DEFAULT NULL)

Deletes a record.  The record must exist to be deleted.

Parameters
p_fgac_code   FGAC group code. VARCHAR2(30) Required Key.
p_fdmn_code   FGAC domain code. VARCHAR2(30) Required Key.
p_fprd_seqno   One-up number per predicate and domain combination to allow multiple predicates per domain. NUMBER(4) Required Key.
p_fbpr_code   FGAC business profile code. VARCHAR2(30) Required Key.
p_rowid   Database ROWID of the record to be deleted. VARCHAR2(18) Optional.


p_lock

PROCEDURE p_lock(p_fgac_code   gorfgbp.gorfgbp_fgac_code%TYPE,
                 p_fdmn_code   gorfgbp.gorfgbp_fdmn_code%TYPE,
                 p_fprd_seqno  gorfgbp.gorfgbp_fprd_seqno%TYPE,
                 p_fbpr_code   gorfgbp.gorfgbp_fbpr_code%TYPE,
                 p_rowid_inout IN OUT VARCHAR2)

Locks a record.
If the ROWID is not passed in, the record is located using the key values.
The ROWID of the locked row is passed back as p_rowid_inout.

Parameters
p_fgac_code   FGAC group code. VARCHAR2(30) Required Key.
p_fdmn_code   FGAC domain code. VARCHAR2(30) Required Key.
p_fprd_seqno   One-up number per predicate and domain combination to allow multiple predicates per domain. NUMBER(4) Required Key.
p_fbpr_code   FGAC business profile code. VARCHAR2(30) Required Key.
p_rowid_inout   Database ROWID of the record to be locked. VARCHAR2(18) Required.


p_update

PROCEDURE p_update(p_fgac_code  gorfgbp.gorfgbp_fgac_code%TYPE,
                   p_fdmn_code  gorfgbp.gorfgbp_fdmn_code%TYPE,
                   p_fprd_seqno gorfgbp.gorfgbp_fprd_seqno%TYPE,
                   p_fbpr_code  gorfgbp.gorfgbp_fbpr_code%TYPE,
                   p_select_ind gorfgbp.gorfgbp_select_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_insert_ind gorfgbp.gorfgbp_insert_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_update_ind gorfgbp.gorfgbp_update_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_delete_ind gorfgbp.gorfgbp_delete_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_user_id    gorfgbp.gorfgbp_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_rowid      VARCHAR2 DEFAULT NULL)

Updates a record.  A record must exist to be updateable.  Non-key items may be updated.

Parameters
p_fgac_code   FGAC group code. VARCHAR2(30) Required Key.
p_fdmn_code   FGAC domain code. VARCHAR2(30) Required Key.
p_fprd_seqno   One-up number per predicate and domain combination to allow multiple predicates per domain. NUMBER(4) Required Key.
p_fbpr_code   FGAC business profile code. VARCHAR2(30) Required.
p_select_ind   Indicates if the business profile is for select access. VARCHAR2(1) Optional.
p_insert_ind   Indicates if the business profile is for insert access. VARCHAR2(1) Optional.
p_update_ind   Indicates if the business profile is for update access. VARCHAR2(1) Optional.
p_delete_ind   Indicates if the business profile is for delete access. VARCHAR2(1) Optional.
p_user_id   The Oracle ID of the user who created or last updated the record. VARCHAR2(30) Optional.
p_rowid   Database ROWID of the record to be updated. VARCHAR2(18) Optional.