fixing perm lookup bug
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 13 Feb 2006 20:04:29 +0000 (20:04 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 13 Feb 2006 20:04:29 +0000 (20:04 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3044 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/006.schema.permissions.sql

index 4fee24f..a7ab679 100644 (file)
@@ -149,7 +149,12 @@ CREATE OR REPLACE FUNCTION permission.usr_perms ( INT ) RETURNS SETOF permission
                                        UNION ALL
                        (SELECT -p.id, $1 AS usr, p.perm, p.depth, p.grantable
                          FROM  permission.grp_perm_map p
-                         WHERE p.grp = (SELECT profile FROM actor.usr WHERE id = $1 LIMIT 1))
+                         WHERE p.grp IN (
+                               SELECT  (permission.grp_ancestors(
+                                               (SELECT profile FROM actor.usr WHERE id = $1)
+                                       )).id
+                               )
+                       )
                                        UNION ALL
                        (SELECT -p.id, $1 AS usr, p.perm, p.depth, p.grantable
                          FROM  permission.grp_perm_map p