"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.canReadChannelV2 = canReadChannelV2;
const channel_permission_1 = require("../channel-permission");
const portal_privilege_1 = require("../portal-privilege");
/**
 * Utility to determine if User can view channel posts and channel attributes
 *
 * @export
 * @param {IChannel} channel
 * @param {IUser} user
 * @return {*}  {boolean}
 */
function canReadChannelV2(channel, user = {}) {
    if ((0, portal_privilege_1.hasOrgAdminViewRights)(user, channel.orgId)) {
        return true;
    }
    const channelPermission = new channel_permission_1.ChannelPermission(channel);
    return channelPermission.canReadChannel(user);
}
//# sourceMappingURL=can-read-channel-v2.js.map