summaryrefslogtreecommitdiffstats
path: root/ipa-python/rpcclient.py
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-09-25 13:35:43 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-09-25 13:35:43 -0700
commit765279d82b24da0aac1821fea0c4c02859ffe00c (patch)
treebf8aa13f6f4b03f0265baaaebbc6bff3723ed500 /ipa-python/rpcclient.py
parent0258d017926f33a8d8f493ea594c4b828477a06a (diff)
downloadfreeipa-765279d82b24da0aac1821fea0c4c02859ffe00c.tar.gz
freeipa-765279d82b24da0aac1821fea0c4c02859ffe00c.tar.xz
freeipa-765279d82b24da0aac1821fea0c4c02859ffe00c.zip
Show the list of groups a user belongs to.
Diffstat (limited to 'ipa-python/rpcclient.py')
-rw-r--r--ipa-python/rpcclient.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/ipa-python/rpcclient.py b/ipa-python/rpcclient.py
index 21ea68bc..c662761c 100644
--- a/ipa-python/rpcclient.py
+++ b/ipa-python/rpcclient.py
@@ -258,6 +258,23 @@ class RPCClient:
return ipautil.unwrap_binary_data(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 dicts."""
+ server = self.setup_server()
+ if sattrs is None:
+ sattrs = "__NONE__"
+ try:
+ result = server.get_groups_by_member(member_dn, sattrs)
+ except xmlrpclib.Fault, fault:
+ raise ipaerror.gen_exception(fault.faultCode, fault.faultString)
+ except socket.error, (value, msg):
+ raise xmlrpclib.Fault(value, msg)
+
+ return ipautil.unwrap_binary_data(result)
+
def add_group(self,group,group_container=None):
"""Add a new group. Takes as input a dict where the key is the
attribute name and the value is either a string or in the case