News for hackers. Stuff that matters.
Re:Write logic, not mechanics by gozala on Thursday April 19, 2012 @10:59AM (#3863306)
You just have to write function per operation that is it:

    var auth = promised(function(user, data) {
      var isAdmin = user.role === admin
      return  isAdmin ? render(open("yay.xml"), db.send(data.request))
                      : render(open("no_permissions.xml"), {})
    })
    
    var puser = getUser(data.session)
    return auth(user, data)

There are no comments on this comment yet.