mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-11 02:50:15 +08:00
Rename AncestorPermission to RootPermission
This commit is contained in:
parent
a6109bb301
commit
4822a8c5fe
@ -10,10 +10,10 @@
|
|||||||
package net.mamoe.mirai.console.command
|
package net.mamoe.mirai.console.command
|
||||||
|
|
||||||
import net.mamoe.mirai.console.command.CommandManager.INSTANCE.unregisterAllCommands
|
import net.mamoe.mirai.console.command.CommandManager.INSTANCE.unregisterAllCommands
|
||||||
import net.mamoe.mirai.console.permission.AncestorPermission
|
|
||||||
import net.mamoe.mirai.console.permission.ExperimentalPermission
|
import net.mamoe.mirai.console.permission.ExperimentalPermission
|
||||||
import net.mamoe.mirai.console.permission.PermissionId
|
import net.mamoe.mirai.console.permission.PermissionId
|
||||||
import net.mamoe.mirai.console.permission.PermissionIdNamespace
|
import net.mamoe.mirai.console.permission.PermissionIdNamespace
|
||||||
|
import net.mamoe.mirai.console.permission.RootPermission
|
||||||
import net.mamoe.mirai.console.plugin.jvm.JvmPlugin
|
import net.mamoe.mirai.console.plugin.jvm.JvmPlugin
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,7 +41,7 @@ public interface CommandOwner : PermissionIdNamespace {
|
|||||||
internal object ConsoleCommandOwner : CommandOwner {
|
internal object ConsoleCommandOwner : CommandOwner {
|
||||||
@ExperimentalPermission
|
@ExperimentalPermission
|
||||||
override val basePermission: PermissionId
|
override val basePermission: PermissionId
|
||||||
get() = AncestorPermission.id
|
get() = RootPermission.id
|
||||||
|
|
||||||
@ExperimentalPermission
|
@ExperimentalPermission
|
||||||
override fun permissionId(id: String): PermissionId = PermissionId("console", id)
|
override fun permissionId(id: String): PermissionId = PermissionId("console", id)
|
||||||
|
@ -23,7 +23,7 @@ public abstract class AbstractConcurrentPermissionService<P : Permission> : Perm
|
|||||||
protected abstract fun createPermission(
|
protected abstract fun createPermission(
|
||||||
id: PermissionId,
|
id: PermissionId,
|
||||||
description: String,
|
description: String,
|
||||||
base: PermissionId = AncestorPermission.id
|
base: PermissionId = RootPermission.id
|
||||||
): P
|
): P
|
||||||
|
|
||||||
override fun get(id: PermissionId): P? = permissions[id]
|
override fun get(id: PermissionId): P? = permissions[id]
|
||||||
|
@ -29,7 +29,7 @@ public interface Permission {
|
|||||||
* 所有权限的父权限.
|
* 所有权限的父权限.
|
||||||
*/
|
*/
|
||||||
@ExperimentalPermission
|
@ExperimentalPermission
|
||||||
public object AncestorPermission :
|
public object RootPermission :
|
||||||
Permission {
|
Permission {
|
||||||
override val id: PermissionId = PermissionId("*", "*")
|
override val id: PermissionId = PermissionId("*", "*")
|
||||||
override val description: String get() = "The parent of any permission"
|
override val description: String get() = "The parent of any permission"
|
||||||
@ -51,5 +51,5 @@ public fun Permission.parentsWithSelfSequence(): Sequence<Permission> =
|
|||||||
public class PermissionImpl(
|
public class PermissionImpl(
|
||||||
override val id: PermissionId,
|
override val id: PermissionId,
|
||||||
override val description: String,
|
override val description: String,
|
||||||
override val parentId: PermissionId = AncestorPermission.id
|
override val parentId: PermissionId = RootPermission.id
|
||||||
) : Permission
|
) : Permission
|
@ -45,7 +45,7 @@ public interface PermissionService<P : Permission> {
|
|||||||
public fun register(
|
public fun register(
|
||||||
id: PermissionId,
|
id: PermissionId,
|
||||||
description: String,
|
description: String,
|
||||||
base: PermissionId = AncestorPermission.id
|
base: PermissionId = RootPermission.id
|
||||||
): P
|
): P
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user