Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: 指令的权限判断应当优先于指令解析的反馈 #1414

Open
Hieuzest opened this issue Jun 16, 2024 · 1 comment
Open

Bug: 指令的权限判断应当优先于指令解析的反馈 #1414

Hieuzest opened this issue Jun 16, 2024 · 1 comment
Labels
bug BUG

Comments

@Hieuzest
Copy link

Describe the bug

例如有指令

ctx.command('foo', { authority: 3 }).option('ver', '-v <ver:number>')

当权限不足时,foo权限不足,而foo -v abcd则会报 选项ver输入无效

是否应该将部分逻辑移至on('attach') ? 或者延后parse reject的时机

ref: koishijs/koishi-plugin-switch#3

Steps to reproduce

/

Expected behavior

二者均应报权限不足

Screenshots

No response

Versions

  • OS:
  • Platform:
  • Node version:
  • Koishi version:

Additional context

No response

@Hieuzest Hieuzest added the bug BUG label Jun 16, 2024
@shigma
Copy link
Member

shigma commented Jun 16, 2024

你说的有道理,但是选项本身也是需要判断权限的。可能需要把权限的判断拆分到两个时机来做了……?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug BUG
Projects
None yet
Development

No branches or pull requests

2 participants