Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select distinct(au.id), au.usrname, pgt.name, array_agg(list.code)
- from permission.usr_perm_map pupm
- join actor.usr au on au.id = pupm.usr
- join actor.org_unit child on child.id = au.home_ou
- join actor.org_unit parent on parent.id = child.parent_ou
- join permission.grp_tree pgt on pgt.id = au.profile
- join permission.perm_list list on list.id = pupm.perm
- where pgt.parent = 3
- group by 1, 2, 3
- order by 3, 2 DESC
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement