以按部门进行权限控制为例
1、写个权限配置表,用户名、部门
2、在做cpt或者frm页面时,针对部门字段添加一个筛选项在参数面板中,且该筛选项不能为空、默认值为该用户在权限配置表中的部门
部门筛选项参考sql:
select distinct dept_name from 业务表 t
where dept_name in
(SELECT regexp_substr ((select dept_name
from 权限配置表
where username = '${username}'), '[^,]+', 1, rownum)
FROM dual
connect BY rownum <=
length(regexp_replace
((select dept_name
from 权限配置表
where username = '${username}'), '[^,]', NULL)))
or 1 = 1
and (select count(dept_name) as num
from 权限配置表
where username = '${username}') = 0 |