"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.canDeleteChannel = canDeleteChannel;
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 delete a channel
 * @deprecated replace with canDeleteChannelV2 for v2 discussions
 * @export
 * @param channel
 * @param user
 * @returns {boolean}
 */
function canDeleteChannel(channel, user = {}) {
    if ((0, portal_privilege_1.hasOrgAdminDeleteRights)(user, channel.orgId)) {
        return true;
    }
    return (0, is_authorized_to_modify_channel_by_legacy_permissions_1.isAuthorizedToModifyChannelByLegacyPermissions)(user, channel);
}
//# sourceMappingURL=can-delete-channel.js.map