Add API func ShareEnvironment to client and server API:

ShareEnvironment shares the current environment with the given user.
Under the hood, it adds an environment user to state.