[open-ils-commits] r10901 - branches/rel_1_4/Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Oct 24 14:21:52 EDT 2008
Author: miker
Date: 2008-10-24 14:21:44 -0400 (Fri, 24 Oct 2008)
New Revision: 10901
Modified:
branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql
Log:
give users with STAFF_LOGIN perm a work_ou of their home_ou (unless they have it already)
Modified: branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql
===================================================================
--- branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql 2008-10-24 17:17:52 UTC (rev 10900)
+++ branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql 2008-10-24 18:21:44 UTC (rev 10901)
@@ -275,6 +275,14 @@
SELECT permission.usr_has_object_perm( $1, $2, $3, $4, -1 );
$$ LANGUAGE SQL;
+INSERT INTO permission.usr_work_ou_map (usr, work_ou)
+ SELECT u.id,
+ u.home_ou
+ FROM actor.usr u
+ LEFT JOIN permission.usr_work_ou_map m ON (u.id = m.usr AND u.home_ou = m.work_ou)
+ WHERE m.id IS NULL AND
+ permission.usr_has_perm(u.id,'STAFF_LOGIN',u.home_ou);
+
/* Enable LIKE to use an index for database clusters with locales other than C or POSIX */
CREATE INDEX authority_full_rec_value_tpo_index ON authority.full_rec (value text_pattern_ops);
More information about the open-ils-commits
mailing list