你参考这里的写一下看看
通过finedb库查询某个用户或某个角色的权限问题(初稿)-帆软社区 (fanruan.com)
或者测试以下语句看一下
select
a.realname,
a.username,
a.id,
b.roleid,/*权限id*/
c.name,
e.path,
e.displayname,
e.devicetype
from fine_user a
left join fine_user_role_middle b on a.id=b.userid
left join fine_custom_role c on b.roleid=c.id
left join fine_authority d on b.roleid=d.roleid
and d.authority=2 /*允许的*/
and d.roletype=2/*自定义角色的*/
and d.authoritytype=1/*只要授权查看的*/
join fine_authority_object e on d.authorityentityid=e.parentid
where a.username='zhangshan'/*自己改成你的的账号*/
order by a.username,c.name