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
(Date) published - The published date
Source:
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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
password String <optional>
the new password to be set
Source:

create()

Create a new User.
Parameters:
Name Type Argument Description
options.onSuccess Resource~onSuccess a callback function called in case of a success
options.onFailure Resource~onFailure <optional>
a callback function called in case of a failure
options.baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
See:
Example
Create a User
        var user = new User();
		user.name = 'UserName';
		user.email = 'uName@domain.com';
		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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
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:

deleteAuth(options)

Delete specific support authorizations of a user.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
authId String id of the authorization to be deleted
Source:

generate_xml(p_ischangepass, p_addCategories, baseUrl)

Generates a save/update xml to be posted to the server
Parameters:
Name Type Argument Description
p_ischangepass Boolean flag to add the password category to the xml
p_addCategories Array <optional>
additional categories to be added to the xml
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:

generateUrl()

Overrides Resource's generateUrl method to return the Post url
Source:
See:

generateUrl()

Overrides Resource's generateUrl method to return the request url
Source:
See:

generateUrl()

Overrides Resource's generateUrl method to return the request url
Source:
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:
Returns:
value - the return hardcoded value
Type
String

loadAcceptanceLanes(options)

Load a list of lanes.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
Source:
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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
Source:
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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
Source:
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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
Source:
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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:

loadOauths(options)

Load a list of Oauths.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
Source:
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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
Source:
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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
filters Array <optional>
an array of filters
pagination Object <optional>
an Object with pagination variables (nb and first)
Source:
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:
See:

loadProjects(options)

Load user peojects.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
Source:

loadRepresentations(options)

Load a list of Representations.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
pagination Object <optional>
an Object with pagination variables (nb and first)
filters Array <optional>
an array of filters
Source:
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:
See:

resetPassword(options)

Reset a user's password.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:

saveAuth(options)

Create new support authorizations for a specific user.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
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:

saveDelegation(options)

Create new delegation for a specific user.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
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:

savePreset()

Overrides Resource's savePreset method.DEPRECATED
Source:
See:

saveSet(options)

Overrides Resource's saveSet.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
See:
  • Resource#createSet

update(options)

Override Resource update method.
Parameters:
Name Type Description
options object options to be used during the call
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Source:
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:
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
Properties
Name Type Argument Description
onSuccess Resource~onSuccess a callback function called in case of a success
onFailure Resource~onFailure <optional>
a callback function called in case of a failure
baseUrl String <optional>
base URL. If not set the current base URL will be used
Deprecated:
  • Yes
Source: