           (signature String, Function)
         transferOwnership:
           (signature String, Function)
-        remove:
+        destroy:
           (signature Function)
         addSubscription:
           (signature String, Function)

      if err then callback err
      else oldAddOwner.call this, target, options, callback

  remove_ = @::remove
  remove: secure (client, callback) ->
    JName = require '../name'

    @fetchOwner (err, owner) =>
      return callback err if err
      unless owner.getId().equals client.connection.delegate.getId()
        return callback new KodingError 'You must be the owner to perform this action!'

      removeHelper = (model, err, callback, queue) ->
        return callback err if err
        return queue.next() unless model
        model.remove (err) ->
          return callback err if err
          queue.next()

      removeHelperMany = (klass, models, err, callback, queue) ->
        return callback err if err
        return queue.next() if not models or models.length < 1
        ids = (model._id for model in models)
        klass.remove ({ _id: { $in: ids } }), (err) ->
          return callback err if err
          queue.next()

      daisy queue = [
        => JName.one { name:@slug }, (err, name) ->
          removeHelper name, err, callback, queue

        => @fetchPermissionSet (err, permSet) ->
          removeHelper permSet, err, callback, queue

        => @fetchDefaultPermissionSet (err, permSet) ->
          removeHelper permSet, err, callback, queue

        => @fetchMembershipPolicy (err, policy) ->
          removeHelper policy, err, callback, queue

        => @fetchInvitations (err, requests) ->
          JInvitation = require '../invitation'
          removeHelperMany JInvitation, requests, err, callback, queue

        => @fetchTags (err, tags) ->
          JTag = require '../tag'
          removeHelperMany JTag, tags, err, callback, queue

        =>
          @constructor.emit 'GroupDestroyed', this
          queue.next()

        => remove_.call this, (err) ->
          return callback err if err
          queue.next()

        -> callback null
      ]

  sendNotificationToAdmins: (event, contents) ->
    @fetchAdmins (err, admins) =>

async          = require 'async'
{ Module }     = require 'jraphical'
{ difference } = require 'underscore'

