import { ChannelPermission } from "../channel-permission";
import { hasOrgAdminUpdateRights } from "../portal-privilege";
/**
 * Utility to determine if User has privileges to create a post in a channel
 * @export
 * @param channel
 * @param user
 * @returns {boolean}
 */
export function canCreatePostV2(channel, user = {}) {
    if (hasOrgAdminUpdateRights(user, channel.orgId)) {
        return true;
    }
    if (!channel.allowPost) {
        return false;
    }
    const channelPermission = new ChannelPermission(channel);
    return channelPermission.canPostToChannel(user);
}
//# sourceMappingURL=can-create-post-v2.js.map