Updating User Accounts

Updating User Accounts

The user account update operation is a data operation that allows you to modify the fields of the user account object stored in the Users content type.

In this article:

Single User

To update a single user account, construct an object containing the Id of the user account to be updated and all the fields that you want to change. Then pass the object to the updateSingle() method.

var updateObject = {
   "Id" : item-id
    "DisplayName": "Harper Lee"
};

var el = new Everlive('your-app-id');
el.Users.updateSingle(updateObject,
    function(data){
        alert(JSON.stringify(data));
    },
    function(error){
        alert(JSON.stringify(error));
    });</code></pre>

Multiple Users

The Users.update() method allows you to update either all users in the Users content type or a subset defined by a filter expression. Depending on which way you want to go, pass the following as the second argument:

  • To update all users, pass null.
  • To update a subset of users, pass a filter object.

Any user account Ids that you specify will be ignored. User account can be specified only by filter with Users.update().

You cannot update the following fields with this operation:

  • Username
  • Email
  • Password

The following example filters user accounts on a custom Region field and then sets a single value ShowPrivacyWarning to true for all matching user accounts.

var updateObject = {
    "ShowPrivacyWarning" : true
};
var filter = {
    "Region":"EMEA"
};

var el = new Everlive('your-app-id');
el.Users.update(updateObject, filter
    function(data){
        alert(JSON.stringify(data));
    },
    function(error){
        alert(JSON.stringify(error));
    } );

Instead of passing a plain object as filter, you can also pass an instance of Everlive.Query.

Secret Question and Answer Fields

The update operation can set the SecretQuestionId and SecretAnswer user object fields needed when recovering a forgotten password, just like most other fields. However, even if the current user account has update permissions on the Users content type, you can use it to set only the account's own pair of fields.

Password Field

The password is a part of the Telerik Platform security mechanism and cannot be set with a simple update request to the Users content type. If you specify a password, it will be ignored.

Read more about changing passwords in Changing a User Account Password.

See Also

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.