Merge branch '3030-feature-role-administration-backend' of

github.com:gradido/gradido into 3030-feature-role-administration-backend
This commit is contained in:
Claus-Peter Huebner 2023-07-13 21:14:27 +02:00
commit 03f60fa4d4

View File

@ -39,7 +39,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 RoleNames.ROLE_NAME_ADMIN:
context.role = ROLE_ADMIN