<commit_before>const Settings = require('../settings');

class User {
    constructor(userData) {
        this.userData = userData;
    }

    get _id() {
        return this.userData._id;
    }

    get disabled() {
        return this.userData.disabled;
    }

    get username() {
        return this.userData.username;
    }

    get emailHash() {
        return this.userData.emailHash;
    }

    get tokens() {
        return this.userData.tokens;
    }

    get activiationToken() {
        return this.userData.activiationToken;
    }

    get activiationTokenExpiry() {
        return this.userData.activiationTokenExpiry;
    }

    get resetToken() {
        return this.userData.resetToken;
    }

    get tokenExpires() {
        return this.userData.tokenExpires;
    }

    get disableGravatar() {
        return this.userData.settings && this.userData.settings.disableGravatar;
    }

    get blockList() {
        return this.userData.blockList || [];
    }

    get password() {
        return this.userData.password;
    }

    getWireSafeDetails() {
        let user = {
            _id: this.userData._id,
            username: this.userData.username,
            email: this.userData.email,
            emailHash: this.userData.emailHash,
            settings: this.userData.settings,
            promptedActionWindows: this.userData.promptedActionWindows,
            permissions: this.userData.permissions,
            verified: this.userData.verified
        };

        user = Settings.getUserWithDefaultsSet(user);

        return user;
    }

    getShortSummary() {
        return {
            username: this.username,
            name: this.username,
            emailHash: this.emailHash,
            noAvatar: this.disableGravatar
        };
    }

    getDetails() {
        let user = Object.assign({}, this.userData);
<commit_msg>add permissions to the user object<commit_after>const Settings = require('../settings');

class User {
    constructor(userData) {
        this.userData = userData;
    }

    get _id() {
        return this.userData._id;
    }

    get disabled() {
        return this.userData.disabled;
    }

    get username() {
        return this.userData.username;
    }

    get emailHash() {
        return this.userData.emailHash;
    }

    get tokens() {
        return this.userData.tokens;
    }

    get activiationToken() {
        return this.userData.activiationToken;
    }

    get activiationTokenExpiry() {
        return this.userData.activiationTokenExpiry;
    }

    get resetToken() {
        return this.userData.resetToken;
    }

    get tokenExpires() {
        return this.userData.tokenExpires;
    }

    get disableGravatar() {
        return this.userData.settings && this.userData.settings.disableGravatar;
    }

    get blockList() {
        return this.userData.blockList || [];
    }

    get password() {
        return this.userData.password;
    }

    get permissions() {
        return this.userData.permissions || [];
    }

    getWireSafeDetails() {
        let user = {
            _id: this.userData._id,
            username: this.userData.username,
            email: this.userData.email,
            emailHash: this.userData.emailHash,
            settings: this.userData.settings,
            promptedActionWindows: this.userData.promptedActionWindows,
            permissions: this.userData.permissions,
            verified: this.userData.verified
        };

        user = Settings.getUserWithDefaultsSet(user);

        return user;
    }

    getShortSummary() {
        return {
            username: this.username,
            name: this.username,
            emailHash: this.emailHash,
            noAvatar: this.disableGravatar
        };
    }

    getDetails() {
        let user = Object.assign({}, this.userData);

{'fraction_non_alphanumeric': 0.10093896713615023, 'fraction_numerical': 0.0, 'mean_word_length': 1.9252479023646072, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '474192', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1072, 'n_words': 199}