【问题标题】:Navigation menu access control through DB - Apex oracle通过 DB 进行导航菜单访问控制 - Apex oracle
【发布时间】:2020-06-10 05:06:03
【问题描述】:

我有一个表,其中存储了 Page 及其页码。我只想在导航菜单上显示那些页码分配给最终用户的栏。我该怎么做? 我正在使用 Apex 19.1

【问题讨论】:

    标签: oracle oracle-apex oracle-apex-19.1


    【解决方案1】:

    创建一个返回布尔值的函数,说明某个用户是否可以(或不能)访问某个页面,例如

    create table t_access as
      select 1 page_no, 'LITTLE' app_user, 'Y' yn from dual union all  --> can access page 1
      select 2 page_no, 'LITTLE' app_user, 'N' yn from dual;           --> can NOT access page 2
    
    create or replace function f_access(par_page_no in number, par_app_user in varchar2)
      return boolean 
    as
      l_yn t_access.yn%type;
    begin
      select a.yn
        into l_yn
        from t_access a
        where a.page_no = par_page_no
          and a.app_user = par_app_user;
      return l_yn = 'Y';
    exception
      when no_data_found then
        return false;
    end;
    

    在导航列表条目的 conditions 属性中使用该功能;将其设为“返回布尔值的 PL/SQL 函数体”

        return f_access(1, :APP_USER);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-28
      • 2019-08-13
      相关资源
      最近更新 更多