Advertisement
roganhamby

Custom Permissions

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