From 35b10ce5c2c8dc94ff9f20dfbba8810d2d74b526 Mon Sep 17 00:00:00 2001 From: "jiahua.liu" Date: Tue, 19 May 2020 14:51:40 +0800 Subject: [PATCH] to merge --- .../net/mamoe/mirai/console/command/CommandPermission.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/CommandPermission.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/CommandPermission.kt index e8f52b4b4..dc69cfd96 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/CommandPermission.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/CommandPermission.kt @@ -95,7 +95,7 @@ interface CommandPermission { */ object Console : CommandPermission { override fun CommandSender.hasPermission(): Boolean = false - } + object Default : CommandPermission by (Manager or Console) } @@ -117,7 +117,6 @@ inline fun CommandSender.hasPermission(permission: CommandPermission): Boolean = inline fun CommandPermission.testPermission(sender: CommandSender): Boolean = this.run { sender.hasPermission() } - internal class OrCommandPermission( private val first: CommandPermission, private val second: CommandPermission @@ -127,6 +126,7 @@ internal class OrCommandPermission( } } + internal class AndCommandPermission( private val first: CommandPermission, private val second: CommandPermission