Nhibernate 过滤树权限
我正在尝试创建一个 HQL 查询,该查询将根据用户过滤树。
在树根上我有AllowUsers 和AllowRoles,在每个节点上我有DenyUsers 和DenyNodes。我可以使用过滤到树根上的用户
select e
from oStructureMenu e
join fetch e.Nodes n
where e.Id = :id
and :user in (select u from e.AllowUsers u)
,但是当我添加
and :user in (select f.DenyUsers from n f)
创建的sql时有语法错误
另外我不知道如何将用户的角色与允许或拒绝角色中的角色进行比较任何
帮助将不胜感激...
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 roles collections
Any help will be appreciated...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不应该是这样吗
shouldn't it be