File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { InjectRepository } from "@nestjs/typeorm";
66import { decodeJwt } from "jose" ;
77import { Repository } from "typeorm" ;
88import { ConfigImportOrchestratorService } from "../../../shared/utils/config-import/config-import-orchestrator.service" ;
9- import { Role } from "../../roles/role.enum" ;
9+ import { allRoles , Role } from "../../roles/role.enum" ;
1010import { ClientsProvider } from "../client.provider" ;
1111import { CreateClientDto } from "../dto/create-client.dto" ;
1212import { UpdateClientDto } from "../dto/update-client.dto" ;
@@ -66,14 +66,7 @@ export class KeycloakClientsProvider
6666 * Checks if all the roles are available in the realm. If not they will be created.
6767 */
6868 private init ( ) {
69- const existingRoles : Role [ ] = [
70- Role . Tenants ,
71- Role . Tenants ,
72- Role . IssuanceOffer ,
73- Role . Issuances ,
74- Role . PresentationOffer ,
75- Role . Presentations ,
76- ] ;
69+ const existingRoles : Role [ ] = allRoles ;
7770 return this . kc . roles
7871 . find ( )
7972 . then ( ( roles ) => {
Original file line number Diff line number Diff line change 1+ /**
2+ * Enumeration of all roles available in the system.
3+ */
14export enum Role {
25 //to manage presentation resources
36 Presentations = "presentation:manage" ,
@@ -14,3 +17,16 @@ export enum Role {
1417 // to manage registrar configuration and operations
1518 Registrar = "registrar:manage" ,
1619}
20+
21+ /**
22+ * List of all roles
23+ */
24+ export const allRoles = [
25+ Role . Tenants ,
26+ Role . IssuanceOffer ,
27+ Role . Issuances ,
28+ Role . PresentationOffer ,
29+ Role . Presentations ,
30+ Role . Clients ,
31+ Role . Registrar ,
32+ ] ;
You can’t perform that action at this time.
0 commit comments