File

platform-components-ng/projects/platform-components-lib/src/lib/components/roles/services/privilege.service.ts

Description

Service for role and privilges Serve role members (Users/Groups), create/update/delete role Get and set role privileges

Index

Methods

Constructor

constructor(http: HttpClient, userService: UserService, workflowService: WorkflowService)
Parameters :
Name Type Optional
http HttpClient No
userService UserService No
workflowService WorkflowService No

Methods

deleteRole
deleteRole(roleId: number)

Delete a role

Parameters :
Name Type Optional Description
roleId number No

role id

Observable

duplicateRole
duplicateRole(sourceId: number, targetName: string)

Duplicate a role

Parameters :
Name Type Optional Description
sourceId number No

Id of the role to be duplicated

targetName string No

Name of the new role

Returns : Observable<CreateRoleResponse>

Observable

getAllEnabledContentPrivileges
getAllEnabledContentPrivileges(roleId: number, contentTypeId: number)

Get enabled content privileges for a role and content type

Parameters :
Name Type Optional Description
roleId number No

role id

contentTypeId number No

content type id

Returns : Observable<any>

Observable

getApplicableRoleUsers
getApplicableRoleUsers(roleId: number)

Get all applicable users of a roles (role license users and all users of above licenses)

Parameters :
Name Type Optional Description
roleId number No

role id

Returns : any

Observable<User[]>

getApplicationPrivileges
getApplicationPrivileges(licenseType: string)

Get applicaiton privileges

Parameters :
Name Type Optional Description
licenseType string No

license type

Returns : Observable<any>

Observable

getContentPrivilegesByContentType
getContentPrivilegesByContentType(contentTypeId: number, licenseType: string)

Get associated content privilegs for a content type

Parameters :
Name Type Optional Description
contentTypeId number No

content type id

licenseType string No

license type

Returns : Observable<ResponsePrivilege>

Observable

getEnabledApplicationPrivileges
getEnabledApplicationPrivileges(roleId: number)

Get enabled application privileges for a role

Parameters :
Name Type Optional Description
roleId number No

role id

Returns : Observable<any>

Observable

getLicensesForRoleUpdation
getLicensesForRoleUpdation(roleId: number)

Get valid license types for role

Parameters :
Name Type Optional Description
roleId number No

role id

Returns : any

Observable

getRoleGroups
getRoleGroups(roleId: number)

Get groups of a role

Parameters :
Name Type Optional Description
roleId number No

role id

Observable<Group[]>

getRoleUsers
getRoleUsers(roleId: number)

Get users of a role

Parameters :
Name Type Optional Description
roleId number No

role id

Returns : any

Observable<User[]>

saveRole
saveRole(role: CreateRoleRequest)

Create/Update role's name/applicaiton & content privileges

Parameters :
Name Type Optional Description
role CreateRoleRequest No

Object of type CreateRoleRequest

Returns : Observable<CreateRoleResponse>

Observable

result-matching ""

    No results matching ""