diff options
| author | Tom Harley | 2018-04-20 15:15:46 +0100 |
|---|---|---|
| committer | Tom Harley | 2018-04-20 15:16:25 +0100 |
| commit | 8d0293af5592402448769451f85ce666ed407cb4 (patch) | |
| tree | 95e19e5d09b46c5a509f2c5f58fc57f7956168be /src/auth.ts | |
| parent | reduced # of failing tests (diff) | |
| download | medicine-8d0293af5592402448769451f85ce666ed407cb4.tar.gz medicine-8d0293af5592402448769451f85ce666ed407cb4.zip | |
Finalise CORS support with package corser
Diffstat (limited to 'src/auth.ts')
| -rw-r--r-- | src/auth.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/auth.ts b/src/auth.ts index 14e1170..490ae35 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -211,7 +211,7 @@ export const unauthorisedErr: Errorware = export const isAdmin: Middleware = (req: Request, res: Response, next: NextFunction): void => { // tslint:disable-next-line:no-non-null-assertion - const admin: boolean = req!.user!.object!.userGroups! + const admin: boolean = req.user.object.userGroups .some((x: UserGroup): boolean => x.name === 'admin'); if (!admin) { |
