diff --git a/packages/client/src/hooks/useNavigation.ts b/packages/client/src/hooks/useNavigation.ts index b8d2f445e1..cef1f77661 100644 --- a/packages/client/src/hooks/useNavigation.ts +++ b/packages/client/src/hooks/useNavigation.ts @@ -56,7 +56,10 @@ const routeAccess: NavigationConfig[] = [ }, { name: WORKQUEUE_TABS.sentForApproval, - scopes: [SCOPES.RECORD_SUBMIT_FOR_APPROVAL] + scopes: [ + SCOPES.RECORD_SUBMIT_FOR_APPROVAL, + SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION + ] }, { name: WORKQUEUE_TABS.requiresUpdate, diff --git a/packages/gateway/src/features/correction/root-resolvers.test.ts b/packages/gateway/src/features/correction/root-resolvers.test.ts index 64c83acc38..efd89730ef 100644 --- a/packages/gateway/src/features/correction/root-resolvers.test.ts +++ b/packages/gateway/src/features/correction/root-resolvers.test.ts @@ -24,7 +24,7 @@ describe('Correction root resolvers', () => { beforeEach(() => { registerCertifyToken = jwt.sign( - { scope: ['record.register'] }, + { scope: ['record.registration-request-correction'] }, readFileSync('./test/cert.key'), { subject: '121223', diff --git a/packages/gateway/src/features/correction/root-resolvers.ts b/packages/gateway/src/features/correction/root-resolvers.ts index 0287e2373a..e7555e8d8b 100644 --- a/packages/gateway/src/features/correction/root-resolvers.ts +++ b/packages/gateway/src/features/correction/root-resolvers.ts @@ -41,10 +41,7 @@ export const resolvers: GQLResolver = { { headers: authHeader } ) { if ( - inScope(authHeader, [ - SCOPES.RECORD_REGISTER, - SCOPES.RECORD_SUBMIT_FOR_APPROVAL - ]) + inScope(authHeader, [SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION]) ) { const hasAssignedToThisUser = await checkUserAssignment(id, authHeader) if (!hasAssignedToThisUser) { @@ -62,7 +59,7 @@ export const resolvers: GQLResolver = { { id, details }, { headers: authHeader } ) { - if (inScope(authHeader, [SCOPES.RECORD_REGISTER])) { + if (inScope(authHeader, [SCOPES.RECORD_REGISTRATION_CORRECT])) { const hasAssignedToThisUser = await checkUserAssignment(id, authHeader) if (!hasAssignedToThisUser) { throw new UnassignError('User has been unassigned') @@ -78,7 +75,7 @@ export const resolvers: GQLResolver = { { id, details }, { headers: authHeader } ) { - if (inScope(authHeader, [SCOPES.RECORD_REGISTER])) { + if (inScope(authHeader, [SCOPES.RECORD_REGISTRATION_CORRECT])) { const hasAssignedToThisUser = await checkUserAssignment(id, authHeader) if (!hasAssignedToThisUser) { throw new UnassignError('User has been unassigned') @@ -98,7 +95,7 @@ export const resolvers: GQLResolver = { { id, details }, { headers: authHeader } ) { - if (inScope(authHeader, [SCOPES.RECORD_REGISTER])) { + if (inScope(authHeader, [SCOPES.RECORD_REGISTRATION_CORRECT])) { const hasAssignedToThisUser = await checkUserAssignment(id, authHeader) if (!hasAssignedToThisUser) { throw new UnassignError('User has been unassigned') @@ -118,7 +115,7 @@ export const resolvers: GQLResolver = { { id, details }, { headers: authHeader } ) { - if (inScope(authHeader, [SCOPES.RECORD_REGISTER])) { + if (inScope(authHeader, [SCOPES.RECORD_REGISTRATION_CORRECT])) { const hasAssignedToThisUser = await checkUserAssignment(id, authHeader) if (!hasAssignedToThisUser) { throw new UnassignError('User has been unassigned') @@ -138,7 +135,7 @@ export const resolvers: GQLResolver = { { id, details }, { headers: authHeader } ) { - if (inScope(authHeader, [SCOPES.RECORD_REGISTER])) { + if (inScope(authHeader, [SCOPES.RECORD_REGISTRATION_CORRECT])) { const hasAssignedToThisUser = await checkUserAssignment(id, authHeader) if (!hasAssignedToThisUser) { throw new UnassignError('User has been unassigned') @@ -158,7 +155,7 @@ export const resolvers: GQLResolver = { { id, details }, { headers: authHeader } ) { - if (inScope(authHeader, [SCOPES.RECORD_REGISTER])) { + if (inScope(authHeader, [SCOPES.RECORD_REGISTRATION_CORRECT])) { const hasAssignedToThisUser = await checkUserAssignment(id, authHeader) if (!hasAssignedToThisUser) { throw new UnassignError('User has been unassigned') @@ -178,7 +175,7 @@ export const resolvers: GQLResolver = { { id, details }, { headers: authHeader } ) { - if (inScope(authHeader, [SCOPES.RECORD_REGISTER])) { + if (inScope(authHeader, [SCOPES.RECORD_REGISTRATION_CORRECT])) { const hasAssignedToThisUser = await checkUserAssignment(id, authHeader) if (!hasAssignedToThisUser) { throw new UnassignError('User has been unassigned')