mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 06:24:17 +00:00
Merge pull request #260 from H2-invent/bugfix/whipe_board
bugfix whipe board with new role function.
This commit is contained in:
commit
0071ebacbb
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ var fs = require("./fs_promises.js"),
|
|||
path = require("path"),
|
||||
config = require("./configuration.js"),
|
||||
Mutex = require("async-mutex").Mutex,
|
||||
jwtauth = require("./jwtauth.js");
|
||||
jwtauth = require("./jwtBoardnameAuth.js");
|
||||
|
||||
/**
|
||||
* Represents a board.
|
||||
|
@ -174,7 +174,7 @@ class BoardData {
|
|||
this.addChild(message.parent, message);
|
||||
break;
|
||||
case "clear":
|
||||
if(jwtauth.checkIfModerator(message.token)) {
|
||||
if(jwtauth.roleInBoard(message.token,message.board) === 'moderator') {
|
||||
this.clear();
|
||||
} else {
|
||||
throw new Error("User is not a moderator");
|
||||
|
|
Loading…
Reference in a new issue