summaryrefslogtreecommitdiffstats
path: root/ipa-python/ipaclient.py
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-09-26 15:47:34 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-09-26 15:47:34 -0700
commit1725397a53ad133001b3c558904302cc91832b77 (patch)
tree3296835c9e8e5e105bd2b6309003f38b50f48921 /ipa-python/ipaclient.py
parentf8eda3da3e4cf7053947d365219e82fa7079b9cf (diff)
downloadfreeipa-1725397a53ad133001b3c558904302cc91832b77.tar.gz
freeipa-1725397a53ad133001b3c558904302cc91832b77.tar.xz
freeipa-1725397a53ad133001b3c558904302cc91832b77.zip
Adds methods to manipulate groups by dns.
Renamed some of the user_group parameters to be self-evident. Binary wrapping isn't necessary on strings, so removed from xmlrpc calls.
Diffstat (limited to 'ipa-python/ipaclient.py')
-rw-r--r--ipa-python/ipaclient.py60
1 files changed, 42 insertions, 18 deletions
diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py
index 3093fa976..97792fdd1 100644
--- a/ipa-python/ipaclient.py
+++ b/ipa-python/ipaclient.py
@@ -205,41 +205,65 @@ class IPAClient:
return groups
- def add_user_to_group(self, user, group):
+ def add_member_to_group(self, member_dn, group_cn):
+ """Add a member to an existing group.
+ """
+
+ return self.transport.add_member_to_group(member_dn, group_cn)
+
+ def add_members_to_group(self, member_dns, group_cn):
+ """Add several members to an existing group.
+ member_dns is a list of dns to add
+
+ Returns a list of the dns that were not added.
+ """
+
+ return self.transport.add_members_to_group(member_dns, group_cn)
+
+ def remove_member_from_group(self, member_dn, group_cn):
+ """Remove a member from an existing group.
+ """
+
+ return self.transport.remove_member_from_group(member_dn, group_cn)
+
+ def remove_members_from_group(self, member_dns, group_cn):
+ """Remove several members from an existing group.
+ member_dns is a list of dns to remove
+
+ Returns a list of the dns that were not removed.
+ """
+
+ return self.transport.remove_members_from_group(member_dns, group_cn)
+
+ def add_user_to_group(self, user_uid, group_cn):
"""Add a user to an existing group.
- user is a uid of the user to add
- group is the cn of the group to be added to
"""
- return self.transport.add_user_to_group(user, group)
+ return self.transport.add_user_to_group(user_uid, group_cn)
- def add_users_to_group(self, users, group):
+ def add_users_to_group(self, user_uids, group_cn):
"""Add several users to an existing group.
- user is a list of uids of the users to add
- group is the cn of the group to be added to
+ user_uids is a list of uids of the users to add
- Returns a list of the users that were not added.
+ Returns a list of the user uids that were not added.
"""
- return self.transport.add_users_to_group(users, group)
+ return self.transport.add_users_to_group(user_uids, group_cn)
- def remove_user_from_group(self, user, group):
+ def remove_user_from_group(self, user_uid, group_cn):
"""Remove a user from an existing group.
- user is a uid of the user to remove
- group is the cn of the group to be removed from
"""
- return self.transport.remove_user_from_group(user, group)
+ return self.transport.remove_user_from_group(user_uid, group_cn)
- def remove_users_from_group(self, users, group):
+ def remove_users_from_group(self, user_uids, group_cn):
"""Remove several users from an existing group.
- user is a list of uids of the users to remove
- group is the cn of the group to be removed from
+ user_uids is a list of uids of the users to remove
- Returns a list of the users that were not removed.
+ Returns a list of the user uids that were not removed.
"""
- return self.transport.remove_users_from_group(users, group)
+ return self.transport.remove_users_from_group(user_uids, group_cn)
def update_group(self,group):
"""Update a group entry."""