Altered install scripts to add a base user in the seed data. Also altered install script to correctly accept a 6th parameter. Edited mip_security.authorize so that if no data is returned the system returns false.
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@2894 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -8,6 +8,12 @@ sqlplus %1 @disable_constraints
|
|||||||
|
|
||||||
sqlplus %1 @delete_tables
|
sqlplus %1 @delete_tables
|
||||||
|
|
||||||
|
sqlldr %1 control=prty
|
||||||
|
|
||||||
|
sqlldr %1 control=parl
|
||||||
|
|
||||||
|
sqlldr %1 control=apau
|
||||||
|
|
||||||
sqlldr %1 control=alty
|
sqlldr %1 control=alty
|
||||||
|
|
||||||
sqlldr %1 control=caco
|
sqlldr %1 control=caco
|
||||||
@@ -60,6 +66,8 @@ sqlldr %1 control=poco
|
|||||||
|
|
||||||
sqlplus %1 @enable_constraints
|
sqlplus %1 @enable_constraints
|
||||||
|
|
||||||
|
sqlplus %1 @create_passwords
|
||||||
|
|
||||||
goto :done
|
goto :done
|
||||||
|
|
||||||
:usage
|
:usage
|
||||||
|
|||||||
18
Data/Seed/apau.ctl
Normal file
18
Data/Seed/apau.ctl
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
LOAD DATA
|
||||||
|
INFILE *
|
||||||
|
INTO TABLE apex_authorization
|
||||||
|
REPLACE
|
||||||
|
FIELDS TERMINATED BY '|'
|
||||||
|
(
|
||||||
|
rt_code
|
||||||
|
,component_name
|
||||||
|
,component_type
|
||||||
|
,privilege
|
||||||
|
)
|
||||||
|
BEGINDATA
|
||||||
|
MIPADMIN|10|P|A
|
||||||
|
MIPADMIN|32|P|A
|
||||||
|
MIPADMIN|21|P|A
|
||||||
|
MIPADMIN|20|P|A
|
||||||
|
MIPADMIN|13|P|A
|
||||||
|
MIPADMIN|11|P|A
|
||||||
21
Data/Seed/create_passwords.sql
Normal file
21
Data/Seed/create_passwords.sql
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
DECLARE
|
||||||
|
l_hash varchar2(240);
|
||||||
|
BEGIN
|
||||||
|
FOR l_pwd IN (SELECT id, username
|
||||||
|
FROM parties
|
||||||
|
WHERE username IS NOT NULL) LOOP
|
||||||
|
|
||||||
|
l_hash := mip_security.get_hash(p_username=>l_pwd.username, p_password=>'password');
|
||||||
|
|
||||||
|
INSERT INTO passwords
|
||||||
|
(prty_id
|
||||||
|
,password_hash
|
||||||
|
,created_on)
|
||||||
|
VALUES
|
||||||
|
(l_pwd.id
|
||||||
|
,l_hash
|
||||||
|
,SYSDATE);
|
||||||
|
END LOOP;
|
||||||
|
END;
|
||||||
|
/
|
||||||
|
exit
|
||||||
16
Data/Seed/parl.ctl
Normal file
16
Data/Seed/parl.ctl
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
LOAD DATA
|
||||||
|
INFILE *
|
||||||
|
INTO TABLE party_roles
|
||||||
|
REPLACE
|
||||||
|
FIELDS TERMINATED BY '|'
|
||||||
|
(
|
||||||
|
prty_id
|
||||||
|
,rt_code
|
||||||
|
,id
|
||||||
|
,start_date
|
||||||
|
,end_date
|
||||||
|
,description
|
||||||
|
)
|
||||||
|
BEGINDATA
|
||||||
|
100|MIPADMIN|1001|08-NOV-07|||
|
||||||
|
|
||||||
29
Data/Seed/prty.ctl
Normal file
29
Data/Seed/prty.ctl
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
LOAD DATA
|
||||||
|
INFILE *
|
||||||
|
INTO TABLE parties
|
||||||
|
REPLACE
|
||||||
|
FIELDS TERMINATED BY '|'
|
||||||
|
(
|
||||||
|
manu_ref
|
||||||
|
,created_by
|
||||||
|
,shortcode
|
||||||
|
,name
|
||||||
|
,description
|
||||||
|
,created_on
|
||||||
|
,updated_on
|
||||||
|
,updated_by
|
||||||
|
,mktp_ref
|
||||||
|
,lt_7b_contract_ref
|
||||||
|
,gt_7b_contract_ref
|
||||||
|
,adversarial_contract_ref
|
||||||
|
,username
|
||||||
|
,status
|
||||||
|
,first_name
|
||||||
|
,last_name
|
||||||
|
,personal_title
|
||||||
|
,comments
|
||||||
|
,id
|
||||||
|
,prty_type
|
||||||
|
)
|
||||||
|
BEGINDATA
|
||||||
|
|advantica||||08-NOV-07|||||||advantica|OPEN|Advantica|User|Mr|User|100|PERS
|
||||||
@@ -23,7 +23,8 @@ cd ..\..
|
|||||||
|
|
||||||
if "%6"=="" goto :done
|
if "%6"=="" goto :done
|
||||||
|
|
||||||
goto "%6"
|
if "%6"=="demo" goto :demo
|
||||||
|
if "%6"=="test" doto :test
|
||||||
|
|
||||||
:demo
|
:demo
|
||||||
@echo Demo
|
@echo Demo
|
||||||
|
|||||||
@@ -274,7 +274,8 @@ CREATE OR REPLACE PACKAGE BODY mip_security AS
|
|||||||
RETURN TRUE;
|
RETURN TRUE;
|
||||||
END;
|
END;
|
||||||
END IF;
|
END IF;
|
||||||
|
--JP added block here due to error when no data found
|
||||||
|
BEGIN
|
||||||
SELECT access_allowed
|
SELECT access_allowed
|
||||||
INTO l_access_allowed
|
INTO l_access_allowed
|
||||||
FROM (SELECT auth.component_name
|
FROM (SELECT auth.component_name
|
||||||
@@ -302,7 +303,11 @@ CREATE OR REPLACE PACKAGE BODY mip_security AS
|
|||||||
AND auth.component_type = p_component_type
|
AND auth.component_type = p_component_type
|
||||||
ORDER BY parl.rt_code)
|
ORDER BY parl.rt_code)
|
||||||
WHERE rownum < 2;
|
WHERE rownum < 2;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN no_data_found THEN
|
||||||
|
-- no access if we can't find any data
|
||||||
|
RETURN FALSE;
|
||||||
|
END;
|
||||||
IF nvl(l_access_allowed
|
IF nvl(l_access_allowed
|
||||||
,'NO') = 'YES' THEN
|
,'NO') = 'YES' THEN
|
||||||
RETURN TRUE;
|
RETURN TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user