diff options
| author | josh97josh | 2018-04-22 17:36:39 +0100 |
|---|---|---|
| committer | josh97josh | 2018-04-22 17:36:39 +0100 |
| commit | aec20c7e3c9a01dbb073590201b473da5669e8e1 (patch) | |
| tree | 53df187fd473c1d0ca19568f03995bb462d9f633 /src/auth.ts | |
| parent | Merge branch 'jl247/permissions' into trh/gets (diff) | |
| parent | autocreating logs folder on startup (diff) | |
| download | medicine-aec20c7e3c9a01dbb073590201b473da5669e8e1.tar.gz medicine-aec20c7e3c9a01dbb073590201b473da5669e8e1.zip | |
Merge branch ‘trh/gets’ of ssh://localhost:2222/cs3099group-be-4/project-code into trh/gets
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) { |
