From ea58cffa882952230a3661b4ef83912775dc86e1 Mon Sep 17 00:00:00 2001 From: HotelSync Date: Fri, 17 Apr 2026 11:50:07 +0300 Subject: [PATCH] fix: use correct super_admin role in group ownership transfer check Co-Authored-By: Claude Sonnet 4.6 --- backend/src/routes/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/routes/chat.ts b/backend/src/routes/chat.ts index 2b445d8..592aab6 100644 --- a/backend/src/routes/chat.ts +++ b/backend/src/routes/chat.ts @@ -417,7 +417,7 @@ const chatRoutes: FastifyPluginAsync = async (fastify) => { // Transfer ownership (only current owner or admin can do this) if (transferOwnerTo) { const userId = request.user.sub - if (createdBy !== userId && request.user.role !== 'admin') { + if (createdBy !== userId && request.user.role !== 'super_admin') { return reply.code(403).send({ error: 'Only the group creator can transfer ownership' }) } await db.query('UPDATE chat_rooms SET created_by = $1 WHERE id = $2', [transferOwnerTo, roomId])