define('application/models/production/user', [
'antie/class',
'application/managers/feature'
], function (
Class,
FeatureManager
) {
'use strict';
var featureManager = FeatureManager.getInstance();
return Class.extend({
/**
* Initialises the user model.
*
* @param {Object} data - The data.
*/
init: function (data) {
var profile = data.profile;
this._isOutOfHome = profile.sessionProfileData.isOutOfHome;
this._canRecord = profile.recordingProfileData.isRecordingEnabled;
},
/**
* Returns true if the user can record.
*
* @returns {boolean} - True if the user can record.
*/
canRecord: function () {
return this._canRecord === true;
},
/**
* Returns true if the user is out of home.
*
* @returns {boolean} - True if the user is out of home.
*/
isOutOfHome: function () {
if (featureManager.isOutOfHomeEnabled()) {
return this._isOutOfHome === true;
}
return false;
}
});
});