Initial import
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@2914 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
--application/shared_components/security/authorization/check_agent_access
|
||||
wwv_flow_api.create_security_scheme(
|
||||
p_id => 16097609166220701 + wwv_flow_api.g_id_offset,
|
||||
p_flow_id => wwv_flow.g_flow_id,
|
||||
p_name=>'check agent access',
|
||||
p_scheme_type=>'FUNCTION_RETURNING_BOOLEAN',
|
||||
p_scheme=>'declare'||chr(10)||
|
||||
'cursor c_supplier(cp_enqu_id number) is SELECT prty_id FROM v_latest_rt_code_for_enro where rt_code=''ENQ SUPP'' and enqu_id=cp_enqu_id;'||chr(10)||
|
||||
'supplierid number;'||chr(10)||
|
||||
'begin'||chr(10)||
|
||||
'--copied from main authorization scheme'||chr(10)||
|
||||
'IF wwv_flow_custom_auth.current_page_is_public then'||chr(10)||
|
||||
' return TRUE;'||chr(10)||
|
||||
'else '||chr(10)||
|
||||
''||chr(10)||
|
||||
'if mip_security.page_authorization(p_app_user=>:app_user, p_page_id=>:app_page_id) then'||chr(10)||
|
||||
''||chr(10)||
|
||||
'--scheme code just for enquiry page, checks records against agent'||chr(10)||
|
||||
' if :P3_ID is null then'||chr(10)||
|
||||
' return true;'||chr(10)||
|
||||
' end if; '||chr(10)||
|
||||
' if #OWNER#.mip_parties.get_user_role(v(''APP_USER'')) = ''AGENT'' then '||chr(10)||
|
||||
' open c_supplier(:P3_ID);'||chr(10)||
|
||||
' fetch c_supplier into supplierid;'||chr(10)||
|
||||
' if c_supplier%found then'||chr(10)||
|
||||
' if #OWNER#.mip_parties.has_supplier(v(''APP_USER''), supplierid) then'||chr(10)||
|
||||
' close c_supplier;'||chr(10)||
|
||||
' return true;'||chr(10)||
|
||||
' end if;'||chr(10)||
|
||||
' else'||chr(10)||
|
||||
' close c_supplier;'||chr(10)||
|
||||
' return false;'||chr(10)||
|
||||
' end if;'||chr(10)||
|
||||
' else'||chr(10)||
|
||||
' return true;'||chr(10)||
|
||||
' end if;'||chr(10)||
|
||||
'end if;'||chr(10)||
|
||||
'END IF;'||chr(10)||
|
||||
''||chr(10)||
|
||||
'end;',
|
||||
p_caching=>'BY_USER_BY_PAGE_VIEW',
|
||||
p_error_message=>'Oi');
|
||||
|
||||
|
||||
end;
|
||||
/
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--application/shared_components/security/authorization/master_page_authorization
|
||||
wwv_flow_api.create_security_scheme(
|
||||
p_id => 14565830986682708 + wwv_flow_api.g_id_offset,
|
||||
p_flow_id => wwv_flow.g_flow_id,
|
||||
p_name=>'master_page_authorization',
|
||||
p_scheme_type=>'FUNCTION_RETURNING_BOOLEAN',
|
||||
p_scheme=>'IF wwv_flow_custom_auth.current_page_is_public then'||chr(10)||
|
||||
'return TRUE;'||chr(10)||
|
||||
'else'||chr(10)||
|
||||
'return mip_security.page_authorization(p_app_user=>:app_user, p_page_id=>:app_page_id);'||chr(10)||
|
||||
'END IF;',
|
||||
p_caching=>'BY_USER_BY_PAGE_VIEW',
|
||||
p_error_message=>'You are not authorized to access this page');
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--application/shared_components/security/authorization/page_authorization
|
||||
wwv_flow_api.create_security_scheme(
|
||||
p_id => 14572900838700208 + wwv_flow_api.g_id_offset,
|
||||
p_flow_id => wwv_flow.g_flow_id,
|
||||
p_name=>'PAGE_AUTHORIZATION',
|
||||
p_scheme_type=>'FUNCTION_RETURNING_BOOLEAN',
|
||||
p_scheme=>'return true;'||chr(10)||
|
||||
'IF wwv_flow_custom_auth.current_page_is_public then'||chr(10)||
|
||||
'return TRUE;'||chr(10)||
|
||||
'else'||chr(10)||
|
||||
'return mip_security.page_authorization(p_app_user=>:app_user, p_page_id=>:app_page_id);'||chr(10)||
|
||||
'END IF;',
|
||||
p_caching=>'BY_USER_BY_PAGE_VIEW',
|
||||
p_reference_id=> 14565830986682708,
|
||||
p_error_message=>'You are not authorized to access this page');
|
||||
|
||||
Reference in New Issue
Block a user