Skip to content

Commit

Permalink
Add docstrings for two more functions
Browse files Browse the repository at this point in the history
* Add docstring for organization_member-create.
* Add doctstring for organization_member_delete.
  • Loading branch information
nigelbabu committed May 28, 2013
1 parent 098109f commit 50552be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ckan/logic/action/create.py
Expand Up @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions ckan/logic/action/delete.py
Expand Up @@ -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)


Expand Down

0 comments on commit 50552be

Please sign in to comment.