UserDelegate.js revision 4098d8e8496291ef7a21f5f36fabd292d12f8cdb
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2011-2012 ForgeRock AS. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/*global $, define, _ */
/**
* @author yaromin
*/
define("UserDelegate", [
obj.usersCallback = null;
if(successCallback) {
}
}, error: errorCallback} );
};
/**
* Starting session. Sending username and password to authenticate and returns user's id.
*/
var headers = {};
};
}
this.serviceCall({
};
/**
* Check credentials method
*/
var headers = {};
url: "",
type: "POST",
});
};
/**
* Checks if logged in and returns users id
*/
var uiRoles = {
"openidm-authorized": "ui-user",
"openidm-admin": "ui-admin"
};
url: "",
var i;
if(errorCallback) {
}
} else if(successCallback) {
// previously roles were sometimes stored as a CSV - convert those into a proper array
}
}
}
}
},
});
};
serviceUrl: constants.host + "/openidm/endpoint/securityQA?_action=securityQuestionForUserName&" + $.param({uid: uid}),
url: "",
} else if(errorCallback) {
}
},
});
};
/**
* Check security answer method
*/
serviceUrl: constants.host + "/openidm/endpoint/securityQA?_action=checkSecurityAnswerForUserName&" + $.param({uid: uid, securityAnswer: securityAnswer}),
url: "",
}
},
});
};
/**
* Setting new password for username if security answer is correct
*/
obj.setNewPassword = function(userName, securityAnswer, newPassword, successCallback, errorCallback) {
serviceUrl: constants.host + "/openidm/endpoint/securityQA?_action=setNewPasswordForUserName&" + $.param({newPassword: newPassword, uid: userName, securityAnswer: securityAnswer}),
url: "",
}
},
});
};
if(errorCallback) {
}
} else if(successCallback) {
}
},
});
};
});
};
/**
* See AbstractDelegate.patchEntityDifferences
*/
obj.patchUserDifferences = function(oldUserData, newUserData, successCallback, errorCallback, noChangesCallback) {
obj.patchEntityDifferences({id: oldUserData._id, rev: oldUserData._rev}, oldUserData, newUserData, successCallback, errorCallback, noChangesCallback);
};
/**
* See AbstractDelegate.patchEntity
*/
obj.patchSelectedUserAttributes = function(id, rev, patchDefinitionObject, successCallback, errorCallback, noChangesCallback) {
obj.patchEntity({id: id, rev: rev}, patchDefinitionObject, successCallback, errorCallback, noChangesCallback);
};
return obj;
});