如何实现 Oracle Apex 区域授权

编程入门 行业动态 更新时间:2024-10-16 16:35:16
本文介绍了如何实现 Oracle Apex 区域授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

绑定变量 :app_region_id 工作区域但它不适用于授权方案

The bind variable :app_region_id works region however it does not work for the authorization scheme

区域的 SQL 语句

SELECT WORKSPACE,APPLICATION_ID , PAGE_ID, REGION_ID, REGION_NAME,AUTHORIZATION_SCHEME, :app_region_id from apex_application_page_regions where region_id = :app_region_id

授权方案方案类型:存在SQL查询SQL 查询:

Select 1 from apex_application_page_regions where region_id = :app_region_id;

我应该使用哪个绑定变量来实现区域授权.我想实现的代码,它没有返回想要的结果

which bind variable should I use to achieve region authorization. The code that I wanted to implement, it does not return the desired results

Select 1 from AD_GRP_APEX_REGION_ASSOC r, AD_GRP_EMP e where e.ad_grp = r.ad_grp and e.user_id = :app_user and r.region_id = :app_region_id

推荐答案

变量 :app_region_id 不像 :APP_USER 那样是一个全局变量.授权模式仅适用于与 SESSION 相关联的全局变量,而不适用于页面中的元素(例如区域).除此之外,拥有它没有任何意义,因为您使用 AUTHORIZATION SCHEMAS 来限制对应用程序中不同组件的访问.让我展示如何将授权模式应用于 Oracle Apex 中的区域.

The variable :app_region_id is not a global variable in the same way as :APP_USER. Authorization schemas only work with global variables which are associated to the SESSION, not to a element in a page ( such is a region ). Besides that, it does not make any sense to have it because you use AUTHORIZATION SCHEMAS to limit access to different components in your application. Let me show how to apply authorization schemas to regions in Oracle Apex.

假设我有一个包含三个区域的测试应用程序:

Let's imagine I have a test application with three regions:

  • 区域 1 显示查询的一个字段(一行)
  • 区域 2 显示查询的另一个字段(一行)
  • 区域 3 仅显示一条消息(静态内容)

没有任何身份验证架构,它会显示这一点

Without any authentication schema, it shows this

现在,让我们创建一个授权模式示例,该示例推导出用户是谁,并基于此仅显示区域 3.在我的情况下,我的应用程序默认使用身份验证模式(apex users),因此登录的用户始终分配给全局变量 :APP_USER.

Now, let's create an authorization schema example that derives who is the user and based on this will show only region 3. In my case my application uses the authentication schema by default ( apex users ) so the user logged is always assigned to the global variable :APP_USER.

应用程序生成器 -->共享组件 -->授权模式

Application Builder --> Shared Components --> Authorization schemas

Authorization Schema --> MY_TEST Type --> Exist SQL QUERY select 1 from dual where exists ( select user_name from apex_workspace_apex_users where workspace_name = 'MY_WORKSPACE' and user_name = upper(':APP_USER') )

当用户存在时,此授权模式将禁止查看区域,所以基本上对每个人来说,显然我这样做只是为了测试目的.

This authorisation schema will forbid to see a region when the user exists, so basically for everybody, obviously I am doing it just for testing purposes.

然后我修改了 REGION 1 和 REGION 2 的属性,将授权模式更改为 MY_TEST

Then I modified attributes of REGION 1 and REGION 2 , changing the authorization schema to MY_TEST

现在,当我执行应用程序时,我只能在页面中看到 region3.

Now, when I execute the application , I can only see the region3 in the page.

更多推荐

如何实现 Oracle Apex 区域授权

本文发布于:2023-06-06 01:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/531134.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何实现   区域   Oracle   Apex

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!