Skip to content

Bug: 使用 dialogue 插件时, 权限可能被无视 #1517

@XxLittleCxX

Description

@XxLittleCxX

Describe the bug

同时启用 koishi-plugin-dialogue 和 koishi-plugin-dialogue-context,权限等级1的用户都可以创建问答等
关闭 dialogue-context 后重启,没有问题

Steps to reproduce

同上

Expected behavior

应遵守权限

Screenshots

No response

Versions

  • Koishi version: 4.18.9
  • k-p-dialogue: 4.1.3

Additional context

https://github.com/koishijs/koishi-plugin-dialogue/blob/3afb6c6d3fdf7779a08ef4c7d808a0d9e35609ee/packages/context/src/index.ts#L47

调用 command 时,如果没有 authority,会有默认设置

this.config.permissions ??= [`authority:${config?.authority ?? 1}`]

可能导致下列函数中的判断出问题:

async test(names: Iterable<string>, session: Partial<Session> = {}, cache: Map<string, Promise<boolean>> = new Map()) {

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions