);
}
+ saveRoleDescription=function(){
+ var roleName = $("#editRoleTable #role-edit-name").html();
+ var description = $("#editRoleTable #role-edit-description").val();
+ clearUserMessages();
+ var url = "restServices/redbackServices/roleManagementService/updateRoleDescription?";
+ url += "roleName="+encodeURIComponent(roleName);
+ url += "&roleDescription="+encodeURIComponent(description);
+ $.ajax(url,
+ {
+ type: "GET",
+ dataType: 'json',
+ success: function(data) {
+ $.log("role description updated");
+ displaySuccessMessage($.i18n.prop("role.updated",roleName));
+ },
+ error: function(data){
+ displayErrorMessage("error updating role description");
+ }
+ }
+ );
+
+ }
+
/**
* @param data Role response from redback rest api
*/
<tbody>
<tr>
<td>${$.i18n.prop('name')}:</td>
- <td>${name}</td>
+ <td id="role-edit-name">${name}</td>
</tr>
<tr>
<td>${$.i18n.prop('description')}:</td>
- <td>${description}</td>
+ <td><input type="text" id="role-edit-description" value="${description}"></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <div class="pull-left">
+ <button class="btn" onclick="saveRoleDescription();">${$.i18n.prop('save')}</button>
+ </div>
+ </td>
</tr>
</tbody>
</table>