From 50552bed67617c1404c7a96a680c465e406daf18 Mon Sep 17 00:00:00 2001 From: Nigel Babu Date: Tue, 28 May 2013 12:18:36 +0530 Subject: [PATCH] Add docstrings for two more functions * Add docstring for organization_member-create. * Add doctstring for organization_member_delete. --- ckan/logic/action/create.py | 13 +++++++++++++ ckan/logic/action/delete.py | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/ckan/logic/action/create.py b/ckan/logic/action/create.py index 5b5576fd626..977d5f66038 100644 --- a/ckan/logic/action/create.py +++ b/ckan/logic/action/create.py @@ -1152,6 +1152,19 @@ def group_member_create(context, data_dict): return _group_or_org_member_create(context, data_dict) def organization_member_create(context, data_dict): + '''Make a user a member of an organization + + You must be authorized to edit the organization. + + :param id: the id or name of the organization + :param username: name or id of the user to be made member of the + organization + :param role: role of the user in the organization. One of ``member``, + ``editor``, or ``admin``. + + :returns: the newly created (or updated) membership + :rtype: dictionary + ''' _check_access('organization_member_create', context, data_dict) return _group_or_org_member_create(context, data_dict, is_org=True) diff --git a/ckan/logic/action/delete.py b/ckan/logic/action/delete.py index e866bfad55a..39cbd7e4cf1 100644 --- a/ckan/logic/action/delete.py +++ b/ckan/logic/action/delete.py @@ -444,6 +444,14 @@ def group_member_delete(context, data_dict=None): return _group_or_org_member_delete(context, data_dict) def organization_member_delete(context, data_dict=None): + '''Remove a user from a organization + + You must be authorized to edit the organization. + + :param id: the id or name of the organization + :param username: name or id of the user to be removed + + ''' return _group_or_org_member_delete(context, data_dict)