"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.canEditSite = canEditSite;
const get_prop_1 = require("../objects/get-prop");
const has_base_priv_1 = require("./has-base-priv");
const can_edit_item_1 = require("./can-edit-item");
/**
 * Checks if user has access to edit site in Hub
 * Currently, Hub Home sites are not editable
 * In initiative context, check is delegated to canEditItem for the initiative site item
 * @param {IItem} model
 * @param {IUser} user
 * @returns {boolean}
 */
function canEditSite(model, user) {
    let res = false;
    const isDefaultHubHome = (0, get_prop_1.getProp)(model, "properties.isDefaultHubHome");
    if (!isDefaultHubHome && (0, has_base_priv_1.hasBasePriv)(user)) {
        res = (0, can_edit_item_1.canEditItem)(model, user);
    }
    return res;
}
//# sourceMappingURL=can-edit-site.js.map