 Bongo                  = require 'bongo'
 koding                 = require './../bongo'
+async                  = require 'async'
 
-{ daisy }              = Bongo
 { isLoggedIn }         = require './../helpers'
 { generateFakeClient } = require './../client'
 


  queue = [

    ->
      return res.status(403).send 'not authorized'  unless token

      # fetch invitation
      JInvitation.byCode token, (err, token_) ->
        return res.status(403).send 'not authorized'  if err or not token_
        queue.next()

    ->
      # fetch the group that we have in token
      JGroup.one { slug : name }, (err, group_) ->
        return res.status(500).send 'an error occured'  if err


  ]

  async.series queue


# fetch last members of a group, if we have a permission issue for the current
