module:store/User

module:store/User

User instances are resources corresponding to users that can be authenticated to access the EntryStore repository. The user resource URI can be referred to from access control lists.

Constructor

new (require("store/User"))(entryURI, resourceURI, entryStore, data)

Source:
Parameters:
Name Type Description
entryURI string

URI to an entry where this resource is contained.

resourceURI string

URI to the resource.

entryStore EntryStore

the API's repository instance.

data Object

information about the user, e.g. object with name and homecontext.

Methods

getCustomProperties() → {object}

Source:

Get custom properties.

Returns:
  • key value pairs of custom properties.
Type
object

getHomeContext() → {string}

Source:

Get the home context for this user.

Returns:
  • a context id (not the full resource URI).
Type
string

getLanguage() → {string}

Source:

Get the preferred language of the user.

Returns:
Type
string

getName() → {string}

Source:

Get the name of the user, this is a a unique name (username) in the current repository's _principals context.

Returns:
Type
string

getSource() → {Object}

Source:
Returns:
Type
Object

isDisabled() → {boolean}

Source:

Check if the user is disabled. Disabled users cannot sign in, although they still exist for lookup, e.g. when presenting creators and contributors.

Returns:
Type
boolean

setCustomProperties(customProperties) → {Promise}

Source:

Set a new home context for this user.

Parameters:
Name Type Description
customProperties object
Returns:
Type
Promise

setDisabled(disabled) → {Promise}

Source:

Set the user to be disabled or not.

Parameters:
Name Type Description
disabled boolean
Returns:
Type
Promise

setHomeContext(contextId) → {Promise}

Source:

Set a new home context for this user.

Parameters:
Name Type Description
contextId string

a context id (not the full resource URI).

Returns:
Type
Promise

setLanguage(language) → {Promise}

Source:

Sets the preferred language of a user.

Parameters:
Name Type Description
language string
Returns:
Type
Promise

setName(name) → {Promise}

Source:

Set a new name (username), it will not succeed if it is already in use, for instance by another user or group.

Parameters:
Name Type Description
name string
Returns:
Type
Promise

setPassword(password) → {Promise}

Source:

Set a new password for the user.

Parameters:
Name Type Description
password string

a new password, should be at least 8 characters long.

Returns:
Type
Promise