chack admin fix
This commit is contained in:
parent
d5a00164bb
commit
86748b97e0
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue