 
   { Relationship } = require 'jraphical'
 
-  { Inflector, ObjectId, ObjectRef, secure, daisy, dash, signature } = require 'bongo'
+  { Inflector, ObjectId, ObjectRef, secure, dash, signature } = require 'bongo'
 
   JPermissionSet = require './permissionset'
   { permit }     = JPermissionSet

    membershipPolicy.approvalEnabled = no  if requestType is 'by-invite'

    queue.push(
      -> membershipPolicy.save (err) ->
        if err then callback err
        else queue.next()
      => @addMembershipPolicy membershipPolicy, (err) ->
        if err then callback err
        else queue.next()
    )
    queue.push callback  if callback
    daisy queue

  destroyMemebershipPolicy:(callback) ->
    @fetchMembershipPolicy (err, policy) ->

        { delegate }            = client.connection
        permissionSet         = null
        defaultPermissionSet  = null

        queue = [

          (next) =>
            @fetchPermissionSet (err, model) ->
              return next err  if err
              permissionSet = model
              next()

          (next) =>
            @fetchDefaultPermissionSet (err, model) =>
              return next err  if err

              if model?
                console.log 'already had defaults'
                defaultPermissionSet = model
                permissionSet = model unless permissionSet
                next()
              else
                console.log 'needed defaults fixed'
                fixDefaultPermissions_ this, permissionSet, (err, newModel) ->
                  defaultPermissionSet = newModel
                  next()

        ]

        async.series queue, (err) ->
          return callback err  if err
          callback null, {
            permissionsByModule
            permissions         : permissionSet.permissions
            defaultPermissions  : defaultPermissionSet.permissions
          }

  fetchRolesByAccount: (account, callback) ->

