module.exports = function(model) {
    'use strict';
    let router = require('koa-router')();
    router.get('/projects', projects);
    return router;

    /////////////////

    function* projects(next) {
        let user = this.mcapp.user;
        this.body = yield model.getProjectsForUser(user.id, user.isadmin);
        yield next;
    }

};

module.exports = function(projects) {
    'use strict';
    return {
        all: all
    };

    /////////////////

    function* all(next) {
        let user = this.mcapp.user;
        this.body = yield projects.forUser(user);
        yield next;
    }

};

Rename projects method to all. Changes due to renames in projects model.