如何过滤Apex网格中的数据以显示某些用户组的某些内容? [英] How can I filter data in an Apex Grid to show certain things for certain user groups?
本文介绍了如何过滤Apex网格中的数据以显示某些用户组的某些内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个ADMIN组和一个USER组.我的数据看起来像这样原始:
I have an ADMIN group and a USER group. My data looks something like this raw:
ID ---------- NAME --------- SECTOR
0001 John A
0002 John H
0024 John A
0011 John H
0045 John A
ADMIN组应该只能看到A,而USER组应该只能看到H. 如何在Apex中自定义gridview以根据授权/组对其进行过滤?
The ADMIN group should only be able to see A, and the USER group should only be able to see H. How can I customize the gridview in Apex to filter it based on authorization/groups?
推荐答案
Since you are using APEX built-in groups, there is a function APEX_UTIL.GET_GROUPS_USER_BELONGS_TO that can help you here. It returns a comma-separated list of the groups the user belongs to. So you could use it something like this:
select id, name, sector
from employees
where ((','||apex_util.get_groups_user_belongs_to(:app_user)||',' like '%,ADMIN,%'
and sector = 'A')
or (','||apex_util.get_groups_user_belongs_to(:app_user)||',' like '%,USER,%'
and sector = 'H'))
这篇关于如何过滤Apex网格中的数据以显示某些用户组的某些内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文