Constructor
new (require("store/User"))(entryURI, resourceURI, entryStore, data)
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}
Get custom properties.
Returns:
- key value pairs of custom properties.
- Type
- object
getHomeContext() → {string}
Get the home context for this user.
Returns:
- a context id (not the full resource URI).
- Type
- string
getLanguage() → {string}
Get the preferred language of the user.
Returns:
- Type
- string
getName() → {string}
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}
Returns:
- Type
- Object
isDisabled() → {boolean}
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}
Set a new home context for this user.
Parameters:
Name | Type | Description |
---|---|---|
customProperties |
object |
Returns:
- Type
- Promise
setDisabled(disabled) → {Promise}
Set the user to be disabled or not.
Parameters:
Name | Type | Description |
---|---|---|
disabled |
boolean |
Returns:
- Type
- Promise
setHomeContext(contextId) → {Promise}
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}
Sets the preferred language of a user.
Parameters:
Name | Type | Description |
---|---|---|
language |
string |
Returns:
- Type
- Promise
setName(name) → {Promise}
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}
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