File

projects/apttus/ecommerce/src/lib/modules/crm/services/user.service.ts

Extends

AObjectService

Index

Properties
Methods

Methods

getBrowserLocale
getBrowserLocale(underscore: boolean)

Retrieves the browser locale for the current user

Parameters :
Name Type Optional Default value Description
underscore boolean No true

when set to true, will replace dash ('-') with an underscore ('_')

Returns : any
getCurrentUser
getCurrentUser()
Returns : Observable<User>
getCurrentUserLocale
getCurrentUserLocale(underscore: boolean)

Retrieves the current user locale to support salesforce and other environment

Parameters :
Name Type Optional Default value Description
underscore boolean No true

when set to true, will replace dash ('-') with an underscore ('_')

Returns : Observable<string>

it return replaced string for current user locale

initializeGuestUser
initializeGuestUser()

Method is used to create a guest user record prior to registration. Will set the defaults on the record to browser defaults.

Returns : Observable<User>

a user record containing the browser defaults (will not be committed to db).

isGuest
isGuest()

Used for determining if the current user is a guest user.

Returns : Observable<boolean>

a boolean observable. Will be true if the user is a guest user.

isLoggedIn
isLoggedIn()

Method is used to determine if the user has authenticated and an access token exists.

Returns : Observable<boolean>

a boolean observable

login
login(username: string, password: string)

Primary method for authenticating community users. Uses the SOAP Api to retrieve a session id and associate it with any future calls.

Parameters :
Name Type Optional Description
username string No

The username of the user to login

password string No

The password of the user to login

Returns : Observable<void>
loginOauth
loginOauth()

Method will trigger the oauth process for a connected app. NOTE: You must implement the redirect / callback process and set the returned access token on the force service manually using this.forceService.setAccessToken(...);

Returns : void
logout
logout()

Primary logout method.

Returns : Observable<void>

a void observable when the process has completed.

me
me()

Primary method for retrieving the current user record

Returns : Observable<User>

an observable of type User

register
register(user: User)

Primary method for registering a given user record. Set any defaults on the user record passed in as the first argument. Will associate an account and a profile with the user record based on the community settings.

Parameters :
Name Type Optional Description
user User No

A user record with defaults set

Returns : Observable<User>
sendPasswordResetEmail
sendPasswordResetEmail(username: string)

Method will trigger a password reset for the given username

Parameters :
Name Type Optional Description
username string No

the username to trigger the password reset for.

Returns : Observable<any>
setAlias
setAlias(user: User)

Method generates an alias for the current record based on the first name and last name.

Parameters :
Name Type Optional Description
user User No

the user record to set the alias value on

Returns : void
setCurrency
setCurrency(currencyIsoCode: string, commit: boolean)

Method sets the currency for the current user

Parameters :
Name Type Optional Default value Description
currencyIsoCode string No

the iso code of the currency to set (i.e. 'USD')

commit boolean No false

set to true to commit the change to the db

Returns : Observable<User>
setLocale
setLocale(locale: string, commit: boolean)

Method sets the locale for the current user.

Parameters :
Name Type Optional Default value Description
locale string No
commit boolean No false

(Optional) Set to true to commit the locale to the user record

Returns : Observable<void>

an observable of type User

setPassword
setPassword(newPassword: string)

Method is used to set a password for the current user.

Parameters :
Name Type Optional Description
newPassword string No

the new password to set on the current user.

Returns : Observable<User>
setTimezone
setTimezone(user: User)

Method sets the timezonesidkey for a given user record

Parameters :
Name Type Optional Description
user User No

the user record to set the timezonesidkey on

Returns : void
setUserDefaults
setUserDefaults(user: User)
Parameters :
Name Type Optional
user User No
Returns : void
updateCurrentUser
updateCurrentUser(user: User)
Parameters :
Name Type Optional
user User No
Returns : Observable<User>

Properties

Protected CACHE_KEY
Type : string
Default value : 'User'
type
Default value : User

result-matching ""

    No results matching ""