@progress-chef/platform-org-role-utils-service
v1.0.2
Published
A shared Angular service library that provides organization role utilities for the Chef Platform UI ecosystem. This library handles global roles functionality, allowing tenant-admin roles to be available across all organizations.
Downloads
417
Keywords
Readme
Platform Org Role Utils Service
A shared Angular service library that provides organization role utilities for the Chef Platform UI ecosystem. This library handles global roles functionality, allowing tenant-admin roles to be available across all organizations.
Installation
npm install @progress-chef/platform-org-role-utils-serviceUsage
import { OrgRoleUtilsService } from '@progress-chef/platform-org-role-utils-service';
@Component({
// ...
})
export class MyComponent {
constructor(private orgRoleUtilsService: OrgRoleUtilsService) {}
getRolesForOrganization(orgId: string): any[] {
return this.orgRoleUtilsService.getRolesForOrganization(orgId, this.orgRoleMap, this.allUserRoles);
}
}Features
- Global Role Management: Identifies global roles that should be available across all organizations
- Organization-Specific Roles: Combines org-specific roles with global roles
- Duplicate Prevention: Ensures no duplicate roles in the combined role list
- Tenant Admin Support: Special handling for tenant-admin roles with tenant org ID
API
OrgRoleUtilsService
Methods
getRolesForOrganization(orgId: string, orgRoleMap: any, allUserRoles: any[]): any[]- Gets roles for a specific organization, including global roles
- Returns combined list of org-specific and global roles without duplicates
getGlobalRoles(allUserRoles: any[]): any[]- Identifies global roles that should be available across all organizations
- Currently filters by tenant org ID: "00000000-0000-4000-8000-000000000000"
Development
This library was generated with Angular CLI and follows the standard Angular library structure.
Building
Run ng build platform-org-role-utils-service to build the project. The build artifacts will be stored in the dist/ directory.
Testing
Run ng test platform-org-role-utils-service to execute the unit tests via Jest.
