 
 
   { permit } = require './group/permissionset'
+
+  ADMIN_PERMISSIONS = [
+    { superadmin: yes }
+  ]
 
   @share()
 

          return callback()  unless returnCodes
          return callback null, codes

  createSingleInvite = (client, group, invitationData, end) ->
    { email, role, forceInvite, noEmail } = invitationData


    success: (client, selector, options, callback) ->
      { groupSlug } = selector
      groupName     = client.context.group or 'koding'
      @canFetchInvitationsAsAdmin client, (err, isSuperAdmin) ->
        selector           or= {}
        selector.groupName   = groupName # override group name in any case
        selector.status    or= 'pending'

        if isSuperAdmin and groupSlug
          selector.groupName = groupSlug

        delete selector.groupSlug

        { limit }       = options
        options.sort  or= { createdAt : -1 }
        options.limit or= 25
        options.limit   = Math.min options.limit, 25 # admin can fetch max 25 record
        options.skip   ?= 0

        JInvitation.some selector, options, callback

  # search searches database with given query string, adds `starting
  # with regex` around query param
