File

platform-components-ng/projects/platform-components-lib/src/lib/components/users/service/user.service.ts

Description

User service

Index

Methods

Constructor

constructor(http: HttpClient)
Parameters :
Name Type Optional
http HttpClient No

Methods

_updateUserAvatar
_updateUserAvatar(_userAvatarInfo: any)

Update user avatar

Parameters :
Name Type Optional Description
_userAvatarInfo any No

Avatar Info (User id and avatar file)

Returns : Promise<any>

Promise

addGroup
addGroup(__group: Group)

*** Groups ****

Parameters :
Name Type Optional
__group Group No
addUser
addUser(user: User)

Add user

Parameters :
Name Type Optional Description
user User No

User detail

Returns : Promise<Observable<UserResponse>>

Promise<Observable>

checkTrustee
checkTrustee(trusteeId: number)

Check trustee

Parameters :
Name Type Optional Description
trusteeId number No

Trustee Id

Returns : Observable<boolean>

Observable

deleteGroup
deleteGroup(trusteeID: number, newTrusteeId?: number)

Delete group

Parameters :
Name Type Optional Description
trusteeID number No
newTrusteeId number Yes

New Trustee Id

Returns : Observable<any>

Observable

deleteRoleFromStore
deleteRoleFromStore(roleId: number)

Delete role from store

Parameters :
Name Type Optional Description
roleId number No

Role Id

Returns : void

void

deleteUser
deleteUser(trusteeID: number, newTrusteeId?: number)

Delete user

Parameters :
Name Type Optional Description
trusteeID number No
newTrusteeId number Yes

New Trustee Id

Returns : Observable<any>

Observable

disableCachedRolesForLicenseType
disableCachedRolesForLicenseType()

Disable caching and removes all cached roles

Returns : void

void

Async duplicateGroup
duplicateGroup(groupID: number, targetGroupName: string)

Duplicate group

Parameters :
Name Type Optional Description
groupID number No

Group id

targetGroupName string No

Target group name

Promise<Observable> a promise of Observable for the duplicated group

duplicateUser
duplicateUser(sourceId: number, targetName: string)

Duplicate user

Parameters :
Name Type Optional Description
sourceId number No

Id of source user

targetName string No

User name of duplicate user

Returns : Observable<UserResponse>

created duplicate user and status of the license if assigned or not

enableCachedRolesForLicenseType
enableCachedRolesForLicenseType()

Enable caching of roles for a license type

Returns : void

void

getAccessibleApps
getAccessibleApps()

Get accessible apps

Returns : Observable<any>

Observable

getAdminHomeInfo
getAdminHomeInfo()

Get admin home info

Observable

getAllGroups
getAllGroups()

Get All Groups

Promise<Observable<Group[]>> a promise of Observable for an array of Group DTOs.

getAllRoles
getAllRoles()

*** Roles ****

getAllUsers
getAllUsers()

Get All Users

Promise<Observable<User[]>> a promise of Observable for an array of User DTOs.

getGroup
getGroup(id: number)

Get group detail based on the group ID

Parameters :
Name Type Optional Description
id number No

Group ID

Promise<Observable> Group detail

getGroupMembers
getGroupMembers(groupId: number)

Returns a Promise of an Observable which holds the Group DTO of a group with the given id. Along with the group information, the members of the group are returned in the MemberList of the Group DTO. This function queries the api only when the data is not present in the store.

Parameters :
Name Type Optional Description
groupId number No

Group id

Promise<Observable>

getGroupsState
getGroupsState()

Get group state

Returns : Group[]

Group[]

getLicenseSubscriptions
getLicenseSubscriptions()

Get license subscription

Observable

getRolesForLicenseType
getRolesForLicenseType(licenseType: string)

Get all Platform Roles for a license type

Parameters :
Name Type Optional Description
licenseType string No

license type name

Returns : any

Observable<Role[]>

getTrustee
getTrustee(trusteeId)

Get Trustee

Parameters :
Name Optional Description
trusteeId No

Trustee ID

Returns : Promise<User | Group>

the Promise which holds DTO of user or group based on their userClass. *

getUniqueTrusteeName
getUniqueTrusteeName(trusteeName: string, isUser: boolean)

Get unique trustee name This method returns a unique trustee name by checking the names of all the other trustees present.

Parameters :
Name Type Optional Description
trusteeName string No

Trustee name

isUser boolean No

Is user

Returns : string

string

getUser
getUser(id: number)

Get user This function queries the api only when the data is not present in the store.

Parameters :
Name Type Optional Description
id number No

id

Promise<Observable> a Promise of an Observable which holds the User DTO of a user with the given id.

getUserGroups
getUserGroups(__userId: number)

Get list of groups, user is member of

Parameters :
Name Type Optional
__userId number No
Returns : Promise<Group[]>

Promise that will be resolved to user's Group observable

getUserPasswordExpiry
getUserPasswordExpiry(userName: string)

Get user password expiry

Parameters :
Name Type Optional
userName string No
Returns : Promise<string>

Promise

getUsersState
getUsersState()

Get users state

Returns : User[]

User[]

Async getUserStorage
getUserStorage()

Get user storage

Returns : Promise<UserStorage>

Promise

Async isAuthorAppAccessible
isAuthorAppAccessible()
Returns : {}
keepAlive
keepAlive()

Sends a keepAlive call to the server.

Returns : Promise<any>

Promise

loadUsers
loadUsers()

Load users

Returns : Promise<any>

Promise

setUserPassword
setUserPassword(__userId: number, __password: string)

Set user password

Parameters :
Name Type Optional Description
__userId number No

User Id

__password string No

Password

Observable

updateGroup
updateGroup(group: Group)

Update group

Parameters :
Name Type Optional Description
group Group No

Group detail

Promise<Observable>

updateRoleInStore
updateRoleInStore(role: Role)

Update role in store

Parameters :
Name Type Optional Description
role Role No

Role

Returns : void

void

Async updateRolesList
updateRolesList()

Update role list

Returns : any

void

updateUser
updateUser(user: User)

Update user

Parameters :
Name Type Optional Description
user User No

User detial

Promise<Observable>

updateUserGroups
updateUserGroups(__userId: number, __addedGroupIds: number[], __removedGroupIds: number[])

Update user groups

Parameters :
Name Type Optional Description
__userId number No

User ID

__addedGroupIds number[] No

Array of Groups Ids to add

__removedGroupIds number[] No

Array of Groups Ids to remove

Returns : Observable<any>

Observable

whoAmI
whoAmI()

Get current logged in user details.

Promise<Observable>

result-matching ""

    No results matching ""