@@ -12,7 +12,6 @@ import { ILogger, Logger } from '~/core';
12
12
import { Identity } from '~/core/authentication' ;
13
13
import { DatabaseService } from '~/core/database' ;
14
14
import { ACTIVE , INACTIVE } from '~/core/database/query' ;
15
- import { withoutScope } from '../authorization/dto' ;
16
15
import { ProjectStep } from '../project/dto' ;
17
16
import {
18
17
EngagementStatus ,
@@ -314,7 +313,7 @@ export class EngagementRules {
314
313
315
314
async getAvailableTransitions (
316
315
engagementId : ID ,
317
- currentUserRoles ?: Role [ ] ,
316
+ currentUserRoles ?: readonly Role [ ] ,
318
317
changeset ?: ID ,
319
318
) : Promise < EngagementStatusTransition [ ] > {
320
319
const session = this . identity . current ;
@@ -330,7 +329,7 @@ export class EngagementRules {
330
329
) ;
331
330
332
331
// If current user is not an approver (based on roles) then don't allow any transitions
333
- currentUserRoles ??= session . roles . map ( withoutScope ) ;
332
+ currentUserRoles ??= session . roles ;
334
333
if ( intersection ( approvers , currentUserRoles ) . length === 0 ) {
335
334
return [ ] ;
336
335
}
@@ -358,7 +357,7 @@ export class EngagementRules {
358
357
359
358
async canBypassWorkflow ( ) {
360
359
const session = this . identity . current ;
361
- const roles = session . roles . map ( withoutScope ) ;
360
+ const roles = session . roles ;
362
361
return intersection ( rolesThatCanBypassWorkflow , roles ) . length > 0 ;
363
362
}
364
363
@@ -370,7 +369,7 @@ export class EngagementRules {
370
369
// If current user's roles include a role that can bypass workflow
371
370
// stop the check here.
372
371
const session = this . identity . current ;
373
- const currentUserRoles = session . roles . map ( withoutScope ) ;
372
+ const currentUserRoles = session . roles ;
374
373
if ( intersection ( rolesThatCanBypassWorkflow , currentUserRoles ) . length > 0 ) {
375
374
return ;
376
375
}
0 commit comments