anchor.diff:      [menelaus_util:validate_has_params(_),
        menelaus_util:validate_any_value(name, _),
        menelaus_util:validate_required(roles, _),
  -     menelaus_util:validate_any_value(roles, _)] ++
  +     menelaus_util:validate_any_value(roles, _),
  +     validate_roles(roles, _)] ++
           case Domain of
               local ->
                   [validate_password(_)];
  
positive.code:                 []
          end ++
          [menelaus_util:validate_unsupported_params(_)].
  
  handle_put_user_with_identity({_UserId, Domain} = Identity, Req) ->
      menelaus_util:execute_if_validated(
  
negative.code:                                         Req)
        end, Req, Req:parse_post(), put_user_validators(Domain)).
  
  handle_put_user_validated(Identity, Name, Password, Roles, Req) ->
      UniqueRoles = ordsets:to_list(ordsets:from_list(Roles)),
      case menelaus_users:store_user(Identity, Name, Password, UniqueRoles) of
          {commit, _} ->
              ns_audit:set_user(Req, Identity, UniqueRoles, Name),
              reply_put_delete_users(Req);
          {abort, {error, roles_validation, UnknownRoles}} ->
              menelaus_util:reply_error(
                Req, "roles",
                bad_roles_error([role_to_string(UR) || UR <- UnknownRoles]));
          {abort, password_required} ->
              menelaus_util:reply_error(Req, "password",
                                        "Password is required for new user.");
          {abort, too_many} ->
              menelaus_util:reply_error(
                Req, "_",
                "You cannot create any more users on Community Edition.");
          retry_needed ->
              erlang:error(exceeded_retries)
      end.
  
  handle_delete_user(Domain, UserId, Req) ->
  