import { check } from 'meteor/check';

Meteor.publish("users", function() {
    // if (!this.userId) {
    //     return this.ready();
    // }
    // return Clients.find({});

    if (this.userId) {
        let isMarcoAdmin = Meteor.users.findOne({ _id: this.userId });
        if (isMarcoAdmin.username == "marcoadmin") {

            return Meteor.users.find({ username: { $ne: "marcoadmin" } });
        }

        // return Meteor.users.find({});
        else
            return [];
        // return Clients.find({}, {

        //     reactive: true,
        //     disableOplog: false,
        //     pollingThrottleMs: 1000,
        //     pollingIntervalMs: 1000
        // })


    } else {
        return [];
    }

});