"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.canEditChannel = canEditChannel;
const is_authorized_to_modify_channel_by_legacy_permissions_1 = require("./is-authorized-to-modify-channel-by-legacy-permissions");
const portal_privilege_1 = require("../portal-privilege");
/**
 * Utility to determine if User has privileges to edit a channel
 * @export
 * @deprecated replace with canEditChannelV2 for v2 discussions
 * @param channel
 * @param user
 * @returns {boolean}
 */
function canEditChannel(channel, user = {}) {
    if ((0, portal_privilege_1.hasOrgAdminUpdateRights)(user, channel.orgId)) {
        return true;
    }
    return (0, is_authorized_to_modify_channel_by_legacy_permissions_1.isAuthorizedToModifyChannelByLegacyPermissions)(user, channel);
}
//# sourceMappingURL=can-edit-channel.js.map