在Oracle AS中使用配置文件来分配不同的权限

1、先在公用对象中建立一个自定义的值集;

应用开发员->应用->查找->公用->新建一个公用对象

2、定义用户自定义的配置文件

应用开发员->配置文件->新集一个配置文件,使用上述的公用值集:SQL验证

SQL="select    FL.LOOKUP_CODE, fl.meaning  MEAN
INTO :PROFILE_OPTION_VALUE,
         :VISIBLE_OPTION_VALUE
              from fnd_lookup_VALUES fl
              where fl.lookup_type='CUXXXXX'                    --为公用值集的名称
                  and fl.language='ZHS'"
COLUMN="MEAN(*)"

3、在Form表单中控制:

a、在Form级的WHEN-NEW-FORM-INSTANCE取得当前用户的权限值:

  SELECT pov.profile_option_value
  INTO :parameter.entry_pri_code                    -- 赋给Form表单中的自定义参数
  FROM fnd_profile_options_tl pot,
       fnd_profile_option_values pov,
       fnd_profile_options fpo,
       fnd_user   fu
  WHERE pot.user_profile_option_name='XXXX权限组'
      AND fpo.profile_option_id=pov.profile_option_id
      AND fpo.profile_option_name=pot.profile_option_name
      AND pov.level_value=fu.user_id
      AND pot.language=userenv('LANG')
      AND pov.level_id=10004
      AND fu.user_id=ln_user_id;

b、在BLOCK中控制数据的入口

如在when-new-record_instance中控制Data Block的属性

if :cux_project_info.entry_type_code='01' then
   set_block_property('cux_pa_budget_occur_rate',update_allowed,property_false);
   set_block_property('cux_pa_budget_occur_rate',delete_allowed,property_false);
   set_block_property('CUX_PO_DISTRIBUTION_AMT_V',update_allowed,property_false);
   set_block_property('CUX_PO_DISTRIBUTION_AMT_V',delete_allowed,property_false);
   set_block_property('CUX_PO_DISTRIBUTION_AMT_V',insert_allowed,property_false);
   begin
       :cux_project_info.total_budget_occur_rate:=round(nv(:control.sum_contract_amount_01,0)/:cux_project_info.budget_amount*100,2);
   exception
      when others then
          :cux_project_info.total_budget_occur_rate:=0;
   end ;
   :cux_project_info.contract_occur_amount:=:control.sum_contract_amount_01;
else      
   set_block_property('cux_pa_budget_occur_rate',update_allowed,property_true);
   set_block_property('cux_pa_budget_occur_rate',delete_allowed,property_true);
   set_block_property('CUX_PO_DISTRIBUTION_AMT_V',update_allowed,property_true);
   :cux_project_info.total_budget_occur_rate:=:control.sum_budget_occur_rate_02;
end if;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值