update users and roles

This commit is contained in:
Keith Woodlock
2012-05-22 17:24:30 +01:00
parent b962474368
commit 87275e1d47
+285 -5
View File
@@ -140,19 +140,24 @@
<li><a href="#users_template">Retrieve new user template</a></li>
<li><a href="#users_retrieve">Retrieve existing user</a></li>
<li><a href="#users_create">Create new user</a></li>
<li><a href="#users_update">Update existing user</a></li>
<li><a href="#users_update">Update existing user</a></li>
<li><a href="#users_delete">Delete existing user</a></li>
</ul>
</div>
<div class="toc-section">
<h4><a href="#roles">Roles</a></h4>
<ul>
<li><a href="#tbd">tbd</a></li>
<li><a href="#roles_list">List roles</a></li>
<li><a href="#roles_template">Retrieve new role template</a></li>
<li><a href="#roles_retrieve">Retrieve existing role</a></li>
<li><a href="#roles_create">Create new role</a></li>
<li><a href="#roles_update">Update existing role</a></li>
</ul>
</div>
<div class="toc-section">
<h4><a href="#permissions">Permissions</a></h4>
<ul>
<li><a href="#tbd">tbd</a></li>
<li><a href="#permissions_list">List application permissions</a></li>
</ul>
</div>
</div>
@@ -167,7 +172,7 @@
<div class="method-description">
<h1>Mifos X API Documentation</h1>
<p>
The Mifox X API is organized around
The Mifos X API is organized around
<a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a>.
Our API is designed to have predictable, resource-oriented
URLs, to use HTTP response codes to indicate API errors, and
@@ -2576,11 +2581,286 @@ Request body:
</div>
</div>
<a id="users_delete" name="users_delete" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Delete existing user</h4>
<p>Delete reference to application user on platform.</p>
</div>
<div class="method-example">
<code class="method-declaration">DELETE https://thedomainname/api/v1/users/11</code>
<code class="method-request">DELETE https://localhost:8443/mifosng-provider/api/v1/users/11
Content-Type: application/json
</code>
<code class="method-response">
{
"entityId": 11
}
</code>
</div>
</div>
<!-- end of users api docs -->
<!-- start of roles api docs -->
<a id="roles" name="users" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h3>Roles</h3>
<p>An API capability to support management of application roles for user administration.</p>
</div>
</div>
<a id="roles_list" name="roles_list" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Retrieve list of roles</h4>
<p>Returns all roles.</p>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/roles">https://localhost:8443/mifosng-provider/api/v1/roles</a>
</p>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/roles</code>
<code class="method-request">GET https://localhost:8443/mifosng-provider/api/v1/roles</code>
<code class="method-response">
{
"roles": [
{
"id": 1,
"orgId": 1,
"name": "Super user",
"description": "This role provides all application permissions.",
"availablePermissions": [],
"selectedPermissions": []
},
{
"id": 2,
"orgId": 1,
"name": "Field officer",
"description": "A field officer role allows the user to add client and loans and view reports but nothing else.",
"availablePermissions": [],
"selectedPermissions": []
},
{
"id": 3,
"orgId": 1,
"name": "Data Entry (Portfolio only)",
"description": "This role allows a user full permissions around client and loan functionality but nothing else.",
"availablePermissions": [],
"selectedPermissions": []
},
{
"id": 4,
"orgId": 1,
"name": "Credit Committe Member",
"description": "This role allows a user to approve reject or withdraw loans (with reporting).",
"availablePermissions": [],
"selectedPermissions": []
},
{
"id": 5,
"orgId": 1,
"name": "Manager",
"description": "This role allows a manager to do anything related to portfolio management and also view all reports.",
"availablePermissions": [],
"selectedPermissions": []
},
{
"id": 6,
"orgId": 1,
"name": "new role test",
"description": "test new role description...",
"availablePermissions": [],
"selectedPermissions": []
},
{
"id": 7,
"orgId": 1,
"name": "new",
"description": "test",
"availablePermissions": [],
"selectedPermissions": []
}
]
}
</code>
</div>
</div>
<a id="roles_template" name="roles_template" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Retrieve new role template details</h4>
<p>Returns details for new role screen</p>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/roles/template">https://localhost:8443/mifosng-provider/api/v1/roles/template</a>
</p>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/roles/template</code>
<code class="method-request">GET https://localhost:8443/mifosng-provider/api/v1/roles/template</code>
<code class="method-response">
{
"id": null,
"orgId": null,
"name": null,
"description": null,
"availablePermissions": [
{
"id": 1,
"orgId": 1,
"name": "User administration ALL",
"description": "An application user will have permission to execute all tasks related to user administration.",
"code": "USER_ADMINISTRATION_SUPER_USER_ROLE",
"groupType": 1
},
{
"id": 2,
"orgId": 1,
"name": "Organisation adminsitration ALL",
"description": "An application user will have permission to execute all tasks related to organisation administration.",
"code": "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE",
"groupType": 2
},
...
...
{
"id": 20,
"orgId": 1,
"name": "Can add a new client.",
"description": "Allows an application user to add a new client.",
"code": "CAN_ENROLL_NEW_CLIENT_ROLE",
"groupType": 3
}
],
"selectedPermissions": []
}
</code>
</div>
</div>
<a id="roles_retrieve" name="roles_retrieve" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Retrieve existing role details</h4>
<p>Returns details for existing application role</p>
<p>Example Request:
<a style="word-wrap: break-word;" href="https://localhost:8443/mifosng-provider/api/v1/roles/1">https://localhost:8443/mifosng-provider/api/v1/roles/1</a>
</p>
</div>
<div class="method-example">
<code class="method-declaration">GET https://thedomainname/api/v1/roles/1</code>
<code class="method-request">GET https://localhost:8443/mifosng-provider/api/v1/roles/1</code>
<code class="method-response">
{
"id": 1,
"orgId": 1,
"name": "Super user",
"description": "This role provides all application permissions.",
"availablePermissions": [
{
"id": 5,
"orgId": 1,
"name": "Can submit new loan application",
"description": "Allows an application user to sumit new loan application.",
"code": "CAN_SUBMIT_NEW_LOAN_APPLICATION_ROLE",
"groupType": 3
},
...
...
{
"id": 19,
"orgId": 1,
"name": "Can enter a repayment against a loan in the past",
"description": "Allows an application user to enter a repayment on the loan where the repayment date is in the past.",
"code": "CAN_MAKE_LOAN_REPAYMENT_IN_THE_PAST_ROLE",
"groupType": 3
},
{
"id": 20,
"orgId": 1,
"name": "Can add a new client.",
"description": "Allows an application user to add a new client.",
"code": "CAN_ENROLL_NEW_CLIENT_ROLE",
"groupType": 3
}
],
"selectedPermissions": [
{
"id": 1,
"orgId": 1,
"name": "User administration ALL",
"description": "An application user will have permission to execute all tasks related to user administration.",
"code": "USER_ADMINISTRATION_SUPER_USER_ROLE",
"groupType": 1
},
...
...
{
"id": 2,
"orgId": 1,
"name": "Organisation adminsitration ALL",
"description": "An application user will have permission to execute all tasks related to organisation administration.",
"code": "ORGANISATION_ADMINISTRATION_SUPER_USER_ROLE",
"groupType": 2
}
]
}
</code>
</div>
</div>
<a id="roles_create" name="roles_create" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Create new role</h4>
<p>Adds new application role to the platform.</p>
</div>
<div class="method-example">
<code class="method-declaration">POST https://thedomainname/api/v1/roles</code>
<code class="method-request">POST https://localhost:8443/mifosng-provider/api/v1/roles
Content-Type: application/json
Request body:
{
"name": "Some role name",
"description": "A description outlining the purpose of this role in relation to the application.",
"selectedItems": ["1", "2", "3"]
}
</code>
<code class="method-response">{
"entityId": 8
}
</code>
</div>
</div>
<a id="roles_update" name="roles_update" class="old-syle-anchor">&nbsp;</a>
<div class="method-section">
<div class="method-description">
<h4>Update existing role</h4>
<p>Update details of an existing application role.</p>
</div>
<div class="method-example">
<code class="method-declaration">PUT https://thedomainname/api/v1/roles/8</code>
<code class="method-request">PUT https://localhost:8443/mifosng-provider/api/v1/roles/8
Content-Type: application/json
Request body:
{
"name": "Some role name update",
"description": "A description outlining the purpose of this role in relation to the application. [updated]",
"selectedItems": ["1", "2", "3", "4", "5"]
}
</code>
<code class="method-response">{
"entityId": 8
}
</code>
</div>
</div>
<!-- -->
</div> <!-- main-content-wrapper -->
</div>