From 86748b97e084f5f8a04f725edf23a3c86395a25f Mon Sep 17 00:00:00 2001 From: jusax23 Date: Thu, 30 Mar 2023 14:50:03 +0200 Subject: [PATCH] chack admin fix --- src/api/user.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api/user.ts b/src/api/user.ts index 8c3547c..e7eaaa8 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -86,14 +86,13 @@ export class Client { let query = await select([rooms.roomID, rooms.owner, rooms.rights, roomMembers.admin], innerJoinUsing(rooms, roomMembers, rooms.roomID, roomMembers.roomID)) .where(and( eq(rooms.name, name), - eq(roomMembers.admin, true), eq(roomMembers.name, this.name), eq(roomMembers.server, this.state == STATE.client ? "local" : this.server.tag) )) .query(db); if (query.length == 0) return -1; if ( - query[0][roomMembers.admin] == 0 + !query[0][roomMembers.admin] && query[0][rooms.owner] != this.accID && !(query[0][rooms.rights] & roomRightRequires) ) return -1;