"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var lodash_1 = require("lodash");
var User = /** @class */ (function () {
    function User(data) {
        if (data) {
            Object.assign(this, data);
        }
    }
    /**
     * @deprecated Use other implementation
     */
    User.prototype.has_access = function (field, subField) {
        return this.hasAccess(field, subField);
    };
    User.prototype.hasAccess = function (field, subField) {
        var privilege = this.authorization_flags && this.authorization_flags[field];
        if (!(0, lodash_1.isNil)(privilege)) {
            if (subField) {
                return privilege[subField];
            }
            return privilege.value;
        }
        return !subField;
    };
    return User;
}());
exports.default = User;
//# sourceMappingURL=User.js.map