From 26ab9a504f504f59cfd3af929dbeac2ddc201ed3 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 11 May 2012 16:15:58 -0400 Subject: Implement permission/aci find by subtree https://fedorahosted.org/freeipa/ticket/2321 --- ipalib/plugins/aci.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ipalib') diff --git a/ipalib/plugins/aci.py b/ipalib/plugins/aci.py index b0be26f5c..f7c6039a9 100644 --- a/ipalib/plugins/aci.py +++ b/ipalib/plugins/aci.py @@ -836,7 +836,18 @@ class aci_find(crud.Search): a.target['targetfilter']['expression'] != kw['filter']: results.remove(a) - # TODO: searching by: subtree + if kw.get('subtree'): + for a in acis: + if 'target' in a.target: + target = a.target['target']['expression'] + else: + results.remove(a) + continue + if kw['subtree'].lower() != target.lower(): + try: + results.remove(a) + except ValueError: + pass acis = [] for result in results: -- cgit