saveRestricted

// Using callbacks (NodeJS or Web Browser)
user
  .saveRestricted(function(error, result) {
    // result is a User object
  });

// Using promises (NodeJS)
user
  .saveRestrictedPromise()
  .then(result => {
    // result is a User object
  });
user.saveRestricted(new ResponseListener<User>() {
  @Override
  public void onSuccess(User user) {

  }

  @Override
  public void onError(JSONObject error) {

  }
});
<?php

use Kuzzle\Security\User;

// ...

/*
 * @var $user User
 */

try {
  $user->saveRestricted();
}
catch (ErrorException $e) {

}

Saves this user as restricted into Kuzzle.


saveRestricted([options], [callback])

ArgumentsTypeDescription
optionsJSON ObjectOptional parameters
callbackfunction(Optional) Callback handling the response

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Return value

Returns the User object to allow chaining.


Callback response

Resolves to a User object.