diff docs/api/api.rst @ 2077:0f87c784756e beta

API changes - added removed_user_from_users_group function - fixed errors on wrong username - normalized add/remove members from groups functions - docs updates
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 14 Feb 2012 23:02:23 +0200
parents 87f0800abc7b
children bdc0ad168006
line wrap: on
line diff
--- a/docs/api/api.rst	Wed Feb 08 02:54:13 2012 +0200
+++ b/docs/api/api.rst	Tue Feb 14 23:02:23 2012 +0200
@@ -283,7 +283,8 @@
 add_user_to_users_group
 -----------------------
 
-Adds a user to a users group. This command can be executed only using api_key
+Adds a user to a users group. If user exists in that group success will be 
+`false`. This command can be executed only using api_key
 belonging to user with admin rights
 
 
@@ -300,7 +301,36 @@
 
     result: {
               "id":  "<newusersgroupmemberid>",
-              "msg": "created new users group member"
+              "success": True|False # depends on if member is in group
+              "msg": "added member <username> to users group <groupname> | 
+                      User is already in that group"
+            }
+    error:  null
+
+
+remove_user_from_users_group
+----------------------------
+
+Removes a user from a users group. If user is not in given group success will
+be `false`. This command can be executed only 
+using api_key belonging to user with admin rights
+
+
+INPUT::
+
+    api_key : "<api_key>"
+    method :  "remove_user_from_users_group"
+    args:     {
+                "group_name" :  "<groupname>",
+                "username" :   "<username>"
+              }
+
+OUTPUT::
+
+    result: {
+              "success":  True|False,  # depends on if member is in group
+              "msg": "removed member <username> from users group <groupname> | 
+                      User wasn't in group"
             }
     error:  null