oracle - 通过 DB 进行导航菜单访问控制 - Apex oracle
问题描述
我有一个表,其中存储有 Page 及其页码。我只想在导航菜单上显示那些页码分配给最终用户的栏。我该怎么做?我正在使用 Apex 19.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;
在导航列表条目的条件属性中使用该函数;使其成为“返回布尔值的 PL/SQL 函数体”为
return f_access(1, :APP_USER);
推荐阅读
- python - 如何修复错误“ValueError:压缩距离矩阵必须仅包含有限值。” 在 seaborn 中使用 Yule 度量进行层次聚类
- html - URI Fragment 的落地位置是变量吗?或者它总是顶部?
- amazon-web-services - 直接从 URL 下载 zip 文件需要哪些存储桶权限?
- php - PHPUnit:使用返回 Iterator 对象的数据提供程序
- ios - SwiftUI,将文本呈现在 HStack 内的屏幕外
- python - 什么是在labview和python之间交换集群数据数组的简单方法
- angular - 在 Angular Autocomplete 中,我在建议中获取先前输入的值,而不是从数组中获取值
- django - 使用 django 文件系统从请求中保存文件
- c# - 如何在 Xamarin Forms 中从 StreamReader 填写表单
- bash - 如何使用嵌套子命令优化 bash 命令?