summaryrefslogtreecommitdiffstats
path: root/ipa-python/rpcclient.py
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-09-28 16:01:42 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-09-28 16:01:42 -0700
commitdbf8c1aeb98c730b7f4a83bfc15062040e331083 (patch)
tree4b1b422e9993d103bffb8764a5b6bc04388f7296 /ipa-python/rpcclient.py
parent0cfccd0f8cf77fd2a4197cb47becea85173ca48a (diff)
downloadfreeipa-dbf8c1aeb98c730b7f4a83bfc15062040e331083.tar.gz
freeipa-dbf8c1aeb98c730b7f4a83bfc15062040e331083.tar.xz
freeipa-dbf8c1aeb98c730b7f4a83bfc15062040e331083.zip
Add group management to the user edit page.
Added a couple more API calls to make the inverse operations easier.
Diffstat (limited to 'ipa-python/rpcclient.py')
-rw-r--r--ipa-python/rpcclient.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/ipa-python/rpcclient.py b/ipa-python/rpcclient.py
index cfeb3d20c..9f02b374f 100644
--- a/ipa-python/rpcclient.py
+++ b/ipa-python/rpcclient.py
@@ -441,6 +441,36 @@ class RPCClient:
return ipautil.unwrap_binary_data(result)
+ def add_groups_to_user(self, group_dns, user_dn):
+ """Given a list of group dn's add them to the user.
+
+ Returns a list of the group dns that were not added.
+ """
+ server = self.setup_server()
+ try:
+ result = server.add_groups_to_user(group_dns, user_dn)
+ 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 remove_groups_from_user(self, group_dns, user_dn):
+ """Given a list of group dn's remove them from the user.
+
+ Returns a list of the group dns that were not removed.
+ """
+ server = self.setup_server()
+ try:
+ result = server.remove_groups_from_user(group_dns, user_dn)
+ 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 update_group(self,oldgroup,newgroup):
"""Update an existing group. oldgroup and newgroup are dicts of attributes"""
server = self.setup_server()