Add new permission nodes
This commit is contained in:
parent
6e2d9c3caa
commit
21af0af1be
2 changed files with 13 additions and 10 deletions
|
|
@ -73,6 +73,9 @@ function Channel(name) {
|
|||
ban: 2, // Ban other users
|
||||
motdedit: 3, // Edit the MOTD
|
||||
filteredit: 3, // Control chat filters
|
||||
filterimport: 3, // Import chat filter list
|
||||
playlistlock: 2, // Lock/unlock the playlist
|
||||
leaderctl: 2, // Give/take leader
|
||||
drink: 1.5, // Use the /d command
|
||||
chat: 0 // Send chat messages
|
||||
};
|
||||
|
|
@ -2131,8 +2134,7 @@ Channel.prototype.setLock = function (locked) {
|
|||
* Handles a user message to change the locked state of the playlist
|
||||
*/
|
||||
Channel.prototype.handleSetLock = function (user, data) {
|
||||
// TODO permission node?
|
||||
if (user.rank < 2) {
|
||||
if (!this.hasPermission(user, "playlistlock")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2161,8 +2163,7 @@ Channel.prototype.importFilters = function (filters) {
|
|||
* Handles a user message to import a list of chat filters
|
||||
*/
|
||||
Channel.prototype.handleImportFilters = function (user, data) {
|
||||
// TODO change to filterimport
|
||||
if (!this.hasPermission(user, "filteredit")) {
|
||||
if (!this.hasPermission(user, "filterimport")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2776,8 +2777,7 @@ Channel.prototype.changeLeader = function (name) {
|
|||
* Handles a user message to assign a new leader
|
||||
*/
|
||||
Channel.prototype.handleChangeLeader = function (user, data) {
|
||||
// TODO permission node?
|
||||
if (user.rank < 2) {
|
||||
if (!this.hasPermission(user, "leaderctl")) {
|
||||
user.kick("Attempted assignLeader with insufficient permission");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue