{"size": 1155, "ext": "js", "max_stars_repo_path": "vendor/fof/masquerade/js/src/admin/index.js", "max_stars_repo_name": "flaiming/broniescz-flarum", "max_stars_repo_stars_event_min_datetime": "2020-03-23T00:49:03.000Z", "max_stars_repo_stars_event_max_datetime": "2020-03-23T00:49:03.000Z", "max_issues_repo_path": "vendor/fof/masquerade/js/src/admin/index.js", "max_issues_repo_name": "acardosodev/acardoso.dev", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "vendor/fof/masquerade/js/src/admin/index.js", "max_forks_repo_name": "acardosodev/acardoso.dev", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.5, "max_line_length": 89, "alphanum_fraction": 0.6614718615}
import {extend} from "flarum/extend";
import app from "flarum/app";
import PermissionGrid from "flarum/components/PermissionGrid";
import Field from "./../lib/models/Field";
import addProfileConfigurePane from './addProfileConfigurePane';

app.initializers.add('fof-masquerade', app => {
    app.store.models['masquerade-field'] = Field;

    // add the permission option for viewing a masquerade profile
    extend(PermissionGrid.prototype, 'viewItems', items => {
        items.add('masquerade-view-profile', {
            icon: 'far fa-id-card',
            label: app.translator.trans('fof-masquerade.admin.permissions.view-profile'),
            permission: 'fof.masquerade.view-profile',
            allowGuest: true
        });
    });
    // add the permission option for creating a masquerade profile
    extend(PermissionGrid.prototype, 'startItems', items => {
        items.add('masquerade-have-profile', {
            icon: 'far fa-id-card',
            label: app.translator.trans('fof-masquerade.admin.permissions.have-profile'),
            permission: 'fof.masquerade.have-profile'
        });
    });

    addProfileConfigurePane();
});
