mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
Update backend/src/graphql/directive/isAuthorized.ts
good hint, many thx... Co-authored-by: Moriz Wahl <moriz.wahl@gmx.de>
This commit is contained in:
parent
928091029a
commit
47bf651ba3
@ -38,7 +38,7 @@ export const isAuthorized: AuthChecker<Context> = async ({ context }, rights) =>
|
||||
})
|
||||
context.user = user
|
||||
context.role = ROLE_USER
|
||||
if (user.userRoles && user.userRoles.length > 0) {
|
||||
if (user.userRoles?.length > 0) {
|
||||
switch (user.userRoles[0].role) {
|
||||
case ROLE_NAMES.ROLE_NAME_ADMIN:
|
||||
context.role = ROLE_ADMIN
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user