From: Rogan Hamby Date: Thu, 3 Aug 2017 19:57:46 +0000 (-0400) Subject: adding deletion of extra permissions and groups for users in remove ou scripts X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=2b5820e71bb2c4b89c6460f63fb3a148807716b0;hp=ef6afc4759daca2c218e5cdee08e9b162bbb9c95 adding deletion of extra permissions and groups for users in remove ou scripts --- diff --git a/remove_ou_data/02_remove_patron_extras.sql b/remove_ou_data/02_remove_patron_extras.sql index ffbd789..fc715d6 100644 --- a/remove_ou_data/02_remove_patron_extras.sql +++ b/remove_ou_data/02_remove_patron_extras.sql @@ -84,6 +84,12 @@ DELETE FROM action.survey_question WHERE survey IN DELETE FROM action.survey WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); +DELETE FROM permission.usr_perm_map WHERE usr IN +(SELECT id FROM actor.usr WHERE home_ou IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del)); + +DELETE FROM permission.usr_grp_map WHERE usr IN +(SELECT id FROM actor.usr WHERE home_ou IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del)); + COMMIT; DROP INDEX actor.tmp_addr_replaces;