The following lines contain the word 'select', 'insert', 'update' or 'delete':
-- Validate that the current user has permission to insert/update/delete
-- IGS_PE_PRSID_GRP_MEM records for the IGS_PE_PERSID_GROUP specified by the
-- group_id. The application owner has full permissions. The IGS_PE_PERSID_GROUP
-- creator identified by IGS_PE_PERSID_GROUP.creator_person_id also has full
-- permissions. Any other users must have a record in the
-- IGS_PE_PRSID_GRP_SEC table with the insert, update and delete
-- permissions specified.
DECLARE
cst_person_id_group CONSTANT
user_synonyms.synonym_name%TYPE := 'IGS_PE_PERSID_GROUP';
cst_insert CONSTANT VARCHAR2(10) := 'INSERT';
cst_update CONSTANT VARCHAR2(10) := 'UPDATE';
cst_delete CONSTANT VARCHAR2(10) := 'DELETE';
v_insert_ind IGS_PE_PRSID_GRP_SEC.insert_ind%TYPE;
v_update_ind IGS_PE_PRSID_GRP_SEC.update_ind%TYPE;
v_delete_ind IGS_PE_PRSID_GRP_SEC.delete_ind%TYPE;
SELECT pig.creator_person_id
FROM IGS_PE_PERSID_GROUP_ALL pig, igs_pe_hz_parties pe
WHERE pig.group_id = cp_group_id
AND pig.creator_person_id = pe.party_id
AND pe.oracle_username = fnd_global.user_name;
SELECT pigs.insert_ind,
pigs.update_ind,
pigs.delete_ind
FROM IGS_PE_PRSID_GRP_SEC pigs,
IGS_PE_HZ_PARTIES pe
WHERE pigs.group_id = cp_group_id
AND pigs.person_id = pe.party_id
AND pe.oracle_username = fnd_global.user_name;
-- The group_creator has full insert/update/delete priviledges.
OPEN c_pig(p_group_id);
FETCH c_pigs INTO v_insert_ind,
v_update_ind,
v_delete_ind;
IF (p_transaction_type = cst_insert AND
v_insert_ind = 'N') THEN
p_message_name:= 'IGS_PE_NO_PRIV_INS';
IF (p_transaction_type = cst_update AND
v_update_ind = 'N') THEN
p_message_name:= 'IGS_PE_NO_PRIV_UPD';
IF (p_transaction_type = cst_delete AND
v_delete_ind = 'N') THEN
p_message_name:= 'IGS_PE_NO_PRIV_DEL';
SELECT 'X'
FROM IGS_PE_ALT_PERS_ID pa,IGS_PE_PERSON_ID_TYP pt
WHERE pa.PE_PERSON_ID=p_person_id
AND pa.person_id_type=pt.person_id_type
AND pt.s_person_id_type='MERGE-INTO';