mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
repair isAuthorized and other user access and findings
This commit is contained in:
parent
c324acc5b9
commit
e018234591
@ -13,6 +13,7 @@ export const MODERATOR_RIGHTS = [
|
||||
RIGHTS.DELETE_CONTRIBUTION_LINK,
|
||||
RIGHTS.UPDATE_CONTRIBUTION_LINK,
|
||||
RIGHTS.ADMIN_CREATE_CONTRIBUTION_MESSAGE,
|
||||
RIGHTS.ADMIN_LIST_ALL_CONTRIBUTION_MESSAGES,
|
||||
RIGHTS.DENY_CONTRIBUTION,
|
||||
RIGHTS.ADMIN_OPEN_CREATIONS,
|
||||
]
|
||||
|
||||
@ -33,6 +33,7 @@ export const isAuthorized: AuthChecker<Context> = async ({ context }, rights) =>
|
||||
try {
|
||||
const user = await User.findOneOrFail({
|
||||
where: { gradidoID: decoded.gradidoID },
|
||||
withDeleted: true,
|
||||
relations: ['emailContact', 'userRoles'],
|
||||
})
|
||||
// console.log('isAuthorized user=', user)
|
||||
|
||||
@ -134,6 +134,7 @@ export class UserResolver {
|
||||
logger.info(`login with ${email}, ***, ${publisherId} ...`)
|
||||
email = email.trim().toLowerCase()
|
||||
const dbUser = await findUserByEmail(email)
|
||||
// console.log('login dbUser=', dbUser)
|
||||
if (dbUser.deletedAt) {
|
||||
throw new LogError('This user was permanently deleted. Contact support for questions', dbUser)
|
||||
}
|
||||
|
||||
@ -56,7 +56,11 @@ export const userFactory = async (
|
||||
}
|
||||
|
||||
// get last changes of user from database
|
||||
// dbUser = await User.findOneOrFail({ id }, { withDeleted: true })
|
||||
dbUser = await User.findOneOrFail({
|
||||
where: { id },
|
||||
withDeleted: true,
|
||||
relations: ['emailContact', 'userRoles'],
|
||||
})
|
||||
|
||||
return dbUser
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user