Class: User
User
new User()
Create a new instance of User
Properties:
| Name | Type | Description |
|---|---|---|
title |
String | user's title |
name |
String | user's name |
email |
String | user's email |
status |
String | user's status |
language |
String | user's language |
profile |
String | user's profile |
receive_alert |
String | is the user marked to receive alert |
password |
String | user's password |
lanes |
Array | Array containing a list of lanes |
lanePools |
Array | Array containing a list of pools loaded from lanes; |
authorizations |
Array | Array containing a list of authorizations |
updated |
Date | The updated date and time |
author |
Object | Contains the data of the user's author |
extension |
Object | Contains the user's extension |
preference |
Object | Contains the user's preference |
poolLinks |
Array | List of pool links |
projects |
Array | List of projects |
delegations |
Array | Contains a list of delegations |
metadata |
Object | Contains the user's metadata |
preferences |
Object | Contains the user's preferences |
oauths |
Array | Contains the user's external applications authorizations |
accessRestrictions |
Array | List of access restrictions |
billingStatus |
String | is the user's bill status |
clientLanguage |
String | is the user's Client Language |
Source: User/User.js, line 71
See:
Examples
Load user from list
var userList = new UserList();
var optUL = {};
optUL.onSuccess = function(){
var user = userList.users[0];
var optU = {};
optU.onSuccess = function(){
alert('User '+user.id+' loaded');
};
user.load(optU);
};
userList.load(optUL);
Load logged in user data
var user = new User();
var optU = {};
optU.onSuccess = function(){
alert('User '+user.id+' loaded');
};
user.load(optU);
Methods
changePassword(options)
Change a user's password.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
password |
String | the new password to be set |
Source: User/User.js, line 885
create()
Create a new User.
Parameters:
| Name | Type | Description |
|---|---|---|
options.onSuccess |
Resource~onSuccess | a callback function called in case of a success |
options.onFailure |
Resource~onFailure | a callback function called in case of a failure |
options.baseUrl |
String | base URL. If not set the current base URL will be used |
Source: User/User.js, line 581
See:
Example
Create a User
var user = new User();
user.name = 'UserName';
user.email = '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="01744f606c6441656e6c60686f2f626e6c">[email protected]</a>';
user.create({
onSuccess : function(){
alert('User '+user.id+' created!');
}
});
createAuthorization(options)
Create new support authorizations for a specific user.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
email |
String | email of the user to authorize |
expires |
Date | expiration date |
Source: User/User.js, line 389
deleteAuth(options)
Delete specific support authorizations of a user.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
authId |
String | id of the authorization to be deleted |
Source: User/User.js, line 852
generate_xml(p_ischangepass, p_addCategories , baseUrl)
Generates a save/update xml to be posted to the server
Parameters:
| Name | Type | Description |
|---|---|---|
p_ischangepass |
Boolean | flag to add the password category to the xml |
p_addCategories |
Array | additional categories to be added to the xml |
baseUrl |
String | base URL. If not set the current base URL will be used |
Source: User/User.js, line 717
generateUrl()
Overrides Resource's generateUrl method to return the Post url
Source: User/User.js, line 635
See:
generateUrl()
Overrides Resource's generateUrl method to return the request url
Source: User/User.js, line 807
See:
generateUrl()
Overrides Resource's generateUrl method to return the request url
Source: User/User.js, line 119
See:
harcodedValues(paramGroup, localID) → {String}
Retrieve harcoded values for the user class.
Parameters:
| Name | Type | Description |
|---|---|---|
paramGroup |
String | group of parameters |
localID |
String | the local identifier |
Source: User/User.js, line 1006
loadAcceptanceLanes(options)
Load a list of lanes.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
Source: User/User.js, line 273
See:
Example
Load Lanes
function loadLanes(p_user){//user object
p_user.loadLanes({
onSuccess : function(){
alert("there are " +p_user.lanes+" lanes");
}
});
};
loadAuthorizations(options)
Load a list of Authorizations.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
Source: User/User.js, line 361
See:
Example
Load Authorizations
function loadAuth(p_user){//user object
p_user.loadAuthorizations({
onSuccess : function(){
alert("there are " +p_user.authorizations.length+" authorizations");
}
});
};
loadDelegations(options)
Load a list of Delegations.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
Source: User/User.js, line 417
See:
Example
Load Delegations
function loadDel(p_user){//user object
p_user.loadDelegations({
onSuccess : function(){
alert("there are " +p_user.delegations.length+" delegations");
}
});
};
loadLanes(options)
Load a list of lanes.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
Source: User/User.js, line 233
See:
Example
Load Lanes
function loadLanes(p_user){//user object
p_user.loadLanes({
onSuccess : function(){
alert("there are " +p_user.lanes+" lanes");
}
});
};
loadLogginUser(options)
Loads the user currently logged id
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
Source: User/User.js, line 996
loadOauths(options)
Load a list of Oauths.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
Source: User/User.js, line 495
See:
Example
Load Oauths
function loadOauths(p_user){//user object
p_user.loadOauths({
onSuccess : function(){
alert("there are " +p_user.oauths.length+" oauths");
}
});
};
loadOauths2(options)
Load a list of Oauths.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
Source: User/User.js, line 532
See:
Example
Load Oauths
function loadOauths(p_user){//user object
p_user.loadOauths({
onSuccess : function(){
alert("there are " +p_user.oauths.length+" oauths");
}
});
};
loadPoolsSerialized(options)
Load pools in a serialized manner
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
filters |
Array | an array of filters |
pagination |
Object | an Object with pagination variables (nb and first) |
Source: User/User.js, line 311
Example
Load Pools in a serialized manner
function LoadPoolsSerialized(p_user){
p_user.loadPoolsSerialized({
onSuccess:function(){
alert(JSON.stringify(p_user.pools));
alert(JSON.stringify(p_user.lanes));
}
});
}
loadPreset()
Overrides Resource's loadPreset method.
Source: User/User.js, line 113
See:
loadProjects(options)
Load user peojects.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
Source: User/User.js, line 916
loadRepresentations(options)
Load a list of Representations.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
pagination |
Object | an Object with pagination variables (nb and first) |
filters |
Array | an array of filters |
Source: User/User.js, line 456
See:
loadSet(rObject)
Overrides Resource's loadSet method to set local variables after request.
Parameters:
| Name | Type | Description |
|---|---|---|
rObject |
json | JSON representation of the loaded data. |
Source: User/User.js, line 129
See:
resetPassword(options)
Reset a user's password.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
Source: User/User.js, line 800
saveAuth(options)
Create new support authorizations for a specific user.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
email |
String | email of the user to be authorized |
expires |
String | representation on when the authorization expires |
Source: User/User.js, line 822
saveDelegation(options)
Create new delegation for a specific user.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
delegatedUser |
User | the user to be delegated |
startDate |
Date | the date in which the delegation becomes active |
Source: User/User.js, line 961
savePreset()
Overrides Resource's savePreset method.DEPRECATED
Source: User/User.js, line 557
See:
saveSet(options)
Overrides Resource's saveSet.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
Source: User/User.js, line 199
See:
- Resource#createSet
update(options)
Override Resource update method.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
Source: User/User.js, line 659
See:
Example
Update a User
function updateAUser(p_user){//user object
p_user.name = p_user.name+'new';
p_user.update({
onSuccess : function(){
alert('user '+p_user.id+' updated!');
}
});
};
updatePreset()
Overrides Resource's updatePreset method.
Source: User/User.js, line 629
See:
userDeactivate(options)
DEPRECATED Sets the user status to inactive and posts it to the server
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | options to be used during the call |
onSuccess |
Resource~onSuccess | a callback function called in case of a success |
onFailure |
Resource~onFailure | a callback function called in case of a failure |
baseUrl |
String | base URL. If not set the current base URL will be used |
Source: User/User.js, line 688