From 2b5820e71bb2c4b89c6460f63fb3a148807716b0 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Thu, 3 Aug 2017 15:57:46 -0400 Subject: [PATCH] adding deletion of extra permissions and groups for users in remove ou scripts --- remove_ou_data/02_remove_patron_extras.sql | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) 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; -- 1.7.2.5