开发者

Nhibernate filter tree permissions

开发者 https://www.devze.com 2023-01-02 19:49 出处:网络
I am trying to create an HQL query that will filter a tree based on a user. On the tree root i have AllowUsers and AllowRoles and on each node I have DenyUsers and DenyNodes. I can filter to on the u

I am trying to create an HQL query that will filter a tree based on a user.

On the tree root i have AllowUsers and AllowRoles and on each node I have DenyUsers and DenyNodes. I can filter to on the user on the root of the tree using

select e 
from oStructureMenu e 
  join fetch e.Nodes n 
where e.Id = :id 
  and :user in (select u from e.AllowUsers u)

but when I add

and :user in (select f.DenyUsers from n f)

the sql created has a syntax error

Also I have no idea how I am going to compare the roles for the user to the roles in the allow or deny开发者_StackOverflow社区 roles collections

Any help will be appreciated...


shouldn't it be

and :user in (select f from n.DenyUsers f)
0

精彩评论

暂无评论...
验证码 换一张
取 消