diff options
author | Kevin McCarthy <kmccarth@redhat.com> | 2007-09-25 13:35:43 -0700 |
---|---|---|
committer | Kevin McCarthy <kmccarth@redhat.com> | 2007-09-25 13:35:43 -0700 |
commit | 765279d82b24da0aac1821fea0c4c02859ffe00c (patch) | |
tree | bf8aa13f6f4b03f0265baaaebbc6bff3723ed500 /ipa-python/ipaclient.py | |
parent | 0258d017926f33a8d8f493ea594c4b828477a06a (diff) | |
download | freeipa-765279d82b24da0aac1821fea0c4c02859ffe00c.tar.gz freeipa-765279d82b24da0aac1821fea0c4c02859ffe00c.tar.xz freeipa-765279d82b24da0aac1821fea0c4c02859ffe00c.zip |
Show the list of groups a user belongs to.
Diffstat (limited to 'ipa-python/ipaclient.py')
-rw-r--r-- | ipa-python/ipaclient.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py index 880b47852..6fbd41d58 100644 --- a/ipa-python/ipaclient.py +++ b/ipa-python/ipaclient.py @@ -160,6 +160,15 @@ class IPAClient: result = self.transport.get_group_by_dn(dn,sattrs) return group.Group(result) + def get_groups_by_member(self,member_dn,sattrs=None): + """Gets the groups that member_dn belongs to. + If sattrs is not None then only those + attributes will be returned, otherwise all available + attributes are returned. The result is a list of groups.""" + results = self.transport.get_groups_by_member(member_dn,sattrs) + + return map(lambda result: group.Group(result), results) + def add_group(self,group,group_container=None): """Add a group. group is a ipa.group.Group object""" |