如何限制用户访问Oracle Apex中的页面

发布于 2025-02-13 20:19:11 字数 412 浏览 2 评论 0原文

我对这个Oracle Apex感到非常沮丧,它们在Oracle Apex上没有适当的实践示例或演示,

我构建了一个应用程序,其中有4页 - > 主题,我的帐户,计算总

我应该可以访问上述所有页面

如果我的角色:admin和name:raj…如果我的角色:用户和名称, :bob…我应该只能访问页面:主页和计算总页面,剩下的页面应隐藏

以下是我的表格详细信息: 雇员

Name , Age , Role 
Raj  , 24  , Admin
Bob  , 26  , User 

注意:我正在使用SSO登录

I am very upset with this oracle apex, their is no proper practical example or demonstration on Oracle Apex

I have built one application where I have 4 pages -> Home , My account , Calculate gross

If my Role : Admin and Name : Raj … I should have access to all my above pages

If my Role : user and Name : Bob … I should have access only to page : Home and Calculate gross and remaining pages should be hide

Following is my table details : employee

Name , Age , Role 
Raj  , 24  , Admin
Bob  , 26  , User 

Note : I am using SSO login

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丘比特射中我 2025-02-20 20:19:11

您应该创建授权方案 - 它是在“共享组件”部分中完成的。例如,您可以创建一个名称为“ full_access”的人,其类型是“ pl/sql函数返回布尔值”。

代码取决于实际代表的“角色”和“名称”;我认为它们被存储在一些桌子中。在这种情况下,如果您创建了用户名匹配您提到的名称的Apex用户(例如Raj和Bob),那将是

declare
  l_role t_users.role%type;
begin
  select t.role
    into l_role
    from t_users
    where name = :APP_USER;    --> APP_USER is username of currently logged user

  return l_role = 'Admin';     --> if role is "Admin", function would return TRUE
end;

(随时进行改进。)


然后转到页面本身,请检查其(页面)属性 - 向下滚动到“安全”部分,并将“授权计划”属性设置为“完全访问”。

这样做,任何角色不是“ admin”的app_user无法访问该页面。

You should create authorization schemes - it is done within "Shared components" section. For example, you can create the one whose name is "full_access", its type is "PL/SQL function returning Boolean".

Code depends on what "role" and "name" actually represent; I presume that they are stored into some table. In that case, and if you created Apex users whose username matches name you mentioned (e.g. Raj and Bob), that would be

declare
  l_role t_users.role%type;
begin
  select t.role
    into l_role
    from t_users
    where name = :APP_USER;    --> APP_USER is username of currently logged user

  return l_role = 'Admin';     --> if role is "Admin", function would return TRUE
end;

(Feel free to improve it.)


Then go to the page itself, check its (page's) properties - scroll down to the "Security" section and set the "Authorization scheme" property to "full access".

Doing so, any APP_USER whose role isn't "Admin", won't have access to that page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文