Skip to content

fix: quota 命令不再要求管理员权限 - #4

Merged
TonyCrane merged 1 commit into
mainfrom
unify-newapi-command-permission
Sep 10, 2026
Merged

fix: quota 命令不再要求管理员权限#4
TonyCrane merged 1 commit into
mainfrom
unify-newapi-command-permission

Conversation

@bowling233

Copy link
Copy Markdown
Member

背景:/newapi quota 当前带有 @filter.permission_type(PermissionType.ADMIN),仅 AstrBot 管理员可执行;而 /newapi channel 与 /newapi flow 没有权限装饰器,仅受「会话是否绑定 new-api 实例」控制。两者权限行为不一致。

变更:

  • 移除 quota 命令的 ADMIN 权限装饰器,使 /newapi quota 与 /newapi channel、/newapi flow 统一为相同的权限控制:任何绑定了 new-api 实例的会话均可执行,未绑定会话仍然会被拒绝。
  • 同步更新 README 的权限说明、类 docstring。
  • 版本号 1.4.0 → 1.4.1,补充 CHANGELOG。

插件为只读查询,不修改渠道、不消费重置次数,放开权限不引入写操作风险。

/newapi quota 移除 AstrBot 管理员权限要求,与 /newapi channel、
/newapi flow 保持一致,均对绑定 new-api 实例的会话开放。
Copilot AI lite review requested due to automatic review settings September 10, 2026 02:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues remain.

Pull request overview

Aligns /newapi quota, /newapi channel, and /newapi flow permissions around session binding.

Changes:

  • Removes the administrator-only restriction from quota.
  • Updates documentation, changelog, and version to 1.4.1.
File summaries
File Description
README.md Updates permission documentation
metadata.yaml Bumps plugin version
main.py Removes the admin restriction and updates documentation
CHANGELOG.md Records the permission change
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@TonyCrane TonyCrane changed the title 统一 /newapi quota 与 /newapi channel 的权限控制 fix: quota 命令不再要求管理员权限 Sep 10, 2026
@TonyCrane
TonyCrane merged commit a1409b2 into main Sep 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants