2 * Provides data of the active user.
4 * @author Matthias Schmidt
5 * @copyright 2001-2017 WoltLab GmbH
6 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
7 * @module WoltLabSuite/Core/User
9 define([], function() {
15 * @exports WoltLabSuite/Core/User
19 * Initializes the user object.
21 * @param {int} userId id of the user, `0` for guests
22 * @param {string} username name of the user, empty for guests
24 init: function(userId
, username
) {
26 throw new Error('User has already been initialized.');
29 // define non-writeable properties for userId and username
30 Object
.defineProperty(this, 'userId', {
34 Object
.defineProperty(this, 'username', {