lib/runners/users.js
function setDefaultUser (kontx, next) {
        var a = _.clone(kontx.args);

        if (a.length === 0) { //No args are sent in, set first to be user id
            a[0] = kontx.user._id;
        }
        else if (_.has(a[0], 'include') || _.has(a[0], 'exclude')) { // If first arg is options then reassign
            a[0] = kontx.user._id;
            a[1] = kontx.args[0];
        }

        kontx.args = a;
        next();
    }
function setDefaultUser (kontx, next) {
        var a = _.clone(kontx.args);

        if (a.length === 0) { //No args are sent in, set first to be user id
            a[0] = kontx.user._id;
        }
        else if (_.has(a[0], 'include') || _.has(a[0], 'exclude')) { // If first arg is options then reassign
            a[0] = kontx.user._id;
            a[1] = kontx.args[0];
        }

        kontx.args = a;
        next();
    }
function setDefaultUser ( kontx , next ) { var a = _ . clone ( kontx . args ) ; if ( a . length === 0 ) { //No args are sent in, set first to be user id a [ 0 ] = kontx . user . _id ; } else if ( _ . has ( a [ 0 ] , 'include' ) || _ . has ( a [ 0 ] , 'exclude' ) ) { // If first arg is options then reassign a [ 0 ] = kontx . user . _id ; a [ 1 ] = kontx . args [ 0 ] ; } kontx . args = a ; next ( ) ; }
Middleware that will set the function argument equal to the currently logged in user id if it is left
empty. This can be used for returning back the currently logged in user's information.
@param kontx
@param next
Middleware that will set the function argument equal to the currently logged in user id if it is left empty . This can be used for returning back the currently logged in user s information .