import { ChannelPermission } from "../channel-permission";
import { hasOrgAdminUpdateRights } from "../portal-privilege";
/**
 * Utility to determine if User has privileges to edit a channel
 * @export
 * @param channel
 * @param user
 * @param updateData
 * @returns {boolean}
 */
export function canEditChannelV2(channel, user = {}, updateData) {
    if (hasOrgAdminUpdateRights(user, channel.orgId)) {
        return true;
    }
    const channelPermission = new ChannelPermission(channel);
    return (channelPermission.canModerateChannel(user) &&
        channelPermission.canUpdateProperties(user, updateData));
}
//# sourceMappingURL=can-edit-channel-v2.js.map