$(function() {
- permission=function(name,operation,resource) {
+ Permission=function(name,operation,resource) {
this.name=ko.observable(name);
this.operation=ko.observable(operation);
this.resource=ko.observable(resource);
* @param data Permission response from redback rest api
*/
mapPermission=function(data) {
- return new permission(data.name,
+ return new Permission(data.name,
data.operation?mapOperation(data.operation):null,
data.resource?mapResource(data.resource):null);
}
* @param passwordChangeRequired
* @param ownerViewModel
*/
- user=function(username, password, confirmPassword,fullName,email,permanent,validated,timestampAccountCreation,timestampLastLogin,timestampLastPasswordChange,locked,passwordChangeRequired,ownerViewModel) {
+ User=function(username, password, confirmPassword,fullName,email,permanent,validated,timestampAccountCreation,timestampLastLogin,timestampLastPasswordChange,locked,passwordChangeRequired,ownerViewModel) {
// Potentially Editable Field.
this.username = ko.observable(username);
// Editable Fields.
/**
* view for admin user creation
*/
- adminUserViewModel=function() {
- this.user = new user("admin","","", "the administrator");
+ AdminUserViewModel=function() {
+ this.user = new User("admin","","", "the administrator");
}
/**
adminCreateBox=function() {
window.redbackModel.createUser=true;
jQuery("#main-content").attr("data-bind",'template: {name:"redback/user-edit-tmpl",data: user}');
- var viewModel = new adminUserViewModel();
+ var viewModel = new AdminUserViewModel();
ko.applyBindings(viewModel);
$("#user-create").validate({
rules: {
* @param data User response from redback rest api
*/
mapUser=function(data) {
- return new user(data.username, data.password, null,data.fullName,data.email,data.permanent,data.validated,data.timestampAccountCreation,data.timestampLastLogin,data.timestampLastPasswordChange,data.locked,data.passwordChangeRequired,self);
+ return new User(data.username, data.password, null,data.fullName,data.email,data.permanent,data.validated,data.timestampAccountCreation,data.timestampLastLogin,data.timestampLastPasswordChange,data.locked,data.passwordChangeRequired,self);
}