meteor/meteor — pull request #1510 by zeldovich (2013-10-18 09:12:28+00:00)
Title: accounts-password: allow createUser without also logging in

For some applications, the developer may want to ensure that all
accounts are created by an administrator. This is hard to do in
Meteor right now, for two reasons:

- Either Accounts.createUser() is accessible for everyone (i.e., when
forbidClientAccountCreation is false), or it is prohibited for everyone,
including to the administrator.

- If the administrator calls Accounts.createUser(), the userId is set to
the newly created user, both on the client and on the server, which has
the unfortunate effect of logging out the administrator.

This patch fixes the above two problems, and updates the documentation:

- Accounts.config() now takes an option restrictClientAccountCreation,
which controls when createUser() calls from the client are accepted,
based on the userId of the connection invoking createUser.

- Accounts.createUser() now takes an option suppressLogin, which avoids
switching to the newly created user's userId.