"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.canDeleteChannelV2 = canDeleteChannelV2;
const channel_permission_1 = require("../channel-permission");
const portal_privilege_1 = require("../portal-privilege");
/**
 * Utility to determine if User has privileges to delete a channel
 * @export
 * @param channel
 * @param user
 * @returns {boolean}
 */
function canDeleteChannelV2(channel, user = {}) {
    if ((0, portal_privilege_1.hasOrgAdminDeleteRights)(user, channel.orgId)) {
        return true;
    }
    const channelPermission = new channel_permission_1.ChannelPermission(channel);
    return channelPermission.canDeleteChannel(user);
}
//# sourceMappingURL=can-delete-channel-v2.js.map