 
     daisy _queue
 
+
+  verifyEnrollmentEligibility = (options, queue, callback, fetchData) ->
+
+    { email, client, invitationToken } = options
+
+    # check if user can register to regarding group
+    _options =
+      email           : email
+      groupName       : client.context.group
+      invitationToken : invitationToken
+
+    JUser.verifyEnrollmentEligibility _options, (err, res) ->
+      return callback err  if err
+
+      { isEligible, invitation } = res
+
+      if not isEligible
+        return callback new Error "you can not register to #{client.context.group}"
+
+      fetchData invitation
+      queue.next()
+
+
   createUser = (options, queue, callback, fetchData) ->
 
     { userInfo } = options

        queue.next()

    else
      options_ =
        email    : email
        action   : 'verify-account'
        username : username

      JVerificationToken = require '../verificationtoken'
      JVerificationToken.createNewPin options_, (err, confirmation) ->
        if err
          console.warn 'Failed to send verification token:', err
        else


          queue.next()

      ->
        verifyUser {
          slug
