Skip to content

Commit

Permalink
Minor tisy up
Browse files Browse the repository at this point in the history
  • Loading branch information
euanmillar committed Dec 2, 2024
1 parent 00d19a6 commit 64e57ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/gateway/src/features/role/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Scope } from '@opencrvs/commons/authentication'

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -11,6 +9,8 @@ import { Scope } from '@opencrvs/commons/authentication'
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/

import { Scope } from '@opencrvs/commons/authentication'

export const SYSTEM_ROLE_KEYS = [
'FIELD_AGENT',
'LOCAL_REGISTRAR',
Expand Down
3 changes: 1 addition & 2 deletions packages/gateway/src/features/user/root-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,10 @@ export const resolvers: GQLResolver = {
)
}

// const roles = await getRoles(authHeader)
const { scope: loggedInUserScope } = getTokenPayload(
authHeader.Authorization.split(' ')[1]
)
debugger

if (!canAssignRole(loggedInUserScope, user)) {
throw Error('Create user is only allowed for sysadmin/natlsysadmin')
}
Expand Down

0 comments on commit 64e57ee

Please sign in to comment.