diff --git a/ckan/logic/action/create.py b/ckan/logic/action/create.py index 977d5f66038..fe107aa5197 100644 --- a/ckan/logic/action/create.py +++ b/ckan/logic/action/create.py @@ -1140,10 +1140,13 @@ def group_member_create(context, data_dict): You must be authorized to edit the group. - :param id: the id or name of the group - :param username: name or id of the user to be made member of the group + :param id: the id or name of the group. + :type id: string + :param username: name or id of the user to be made member of the group. + :type username: string :param role: role of the user in the group. One of ``member``, ``editor``, or ``admin``. + :type role: string :returns: the newly created (or updated) membership :rtype: dictionary @@ -1156,11 +1159,14 @@ def organization_member_create(context, data_dict): You must be authorized to edit the organization. - :param id: the id or name of the organization + :param id: the id or name of the organization. + :type id: string :param username: name or id of the user to be made member of the - organization + organization. + :type username: string :param role: role of the user in the organization. One of ``member``, ``editor``, or ``admin``. + :type role: string :returns: the newly created (or updated) membership :rtype: dictionary diff --git a/ckan/logic/action/delete.py b/ckan/logic/action/delete.py index 39cbd7e4cf1..3dddf7584bc 100644 --- a/ckan/logic/action/delete.py +++ b/ckan/logic/action/delete.py @@ -418,7 +418,7 @@ def _group_or_org_member_delete(context, data_dict=None): group_id = data_dict.get('id') group = model.Group.get(group_id) - user_id = data_dict.get('user_id') + user_id = data_dict.get('username') member_dict = { 'id': group.id, 'object': user_id, @@ -433,23 +433,27 @@ def _group_or_org_member_delete(context, data_dict=None): def group_member_delete(context, data_dict=None): - '''Remove a user from a group + '''Remove a user from a group. You must be authorized to edit the group. - :param id: the id or name of the group - :param username: name or id of the user to be removed + :param id: the id or name of the group. + :type id: string + :param username: name or id of the user to be removed. + :type username: string ''' return _group_or_org_member_delete(context, data_dict) def organization_member_delete(context, data_dict=None): - '''Remove a user from a organization + '''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 + :param id: the id or name of the organization. + :type id: string + :param username: name or id of the user to be removed. + :type username: string ''' return _group_or_org_member_delete(context, data_dict) diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py index 1c8ae2530e2..5e6aeffb39e 100644 --- a/ckan/logic/action/get.py +++ b/ckan/logic/action/get.py @@ -658,10 +658,13 @@ def user_list(context, data_dict): def package_relationships_list(context, data_dict): '''Return a dataset (package)'s relationships. - :param id: the id or name of the first package - :param id2: the id or name of the second package - :param rel: relationship as string see ``package_relationship_create()`` - for the relationship types (optional) + :param id: the id or name of the first package. + :type id: string + :param id2: the id or name of the second package. + :type id: string + :param rel: relationship as string see + :func:`ckan.logic.action.create.package_relationship_create()` for the + relationship types (optional). :rtype: list of dictionaries