Skip to content

fix(panel): gate AdminResourceLock on global system_admin only - #883

Open
escaleraalcielo wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
escaleraalcielo:fix/resource-lock-global-admin
Open

fix(panel): gate AdminResourceLock on global system_admin only#883
escaleraalcielo wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
escaleraalcielo:fix/resource-lock-global-admin

Conversation

@escaleraalcielo

@escaleraalcielo escaleraalcielo commented Aug 9, 2026

Copy link
Copy Markdown

Description | 描述

Fixes the Admin account lockout in the MemoryPanel resource-management menu. Previously the 资源管理 (resource management) menu item was shown to any user whose role included admin, even when they were only a team admin — clicking it produced the "资源管理功能暂未对管理员开放" (resource management not yet open to admins) banner and a dead panel. The menu is now gated on global system_admin only, so regular team admins no longer see a menu entry that does nothing.

修复 MemoryPanel 资源管理菜单的管理员锁定问题。此前「资源管理」菜单对任何包含 admin 角色的用户(包括仅 Team 管理员)都会显示,点击后出现「资源管理功能暂未对管理员开放」的提示。现菜单仅对全局 system_admin 开放,普通团队管理员不再看到无功能的菜单项。

  • AdminResourceLock is now computed from the global system admin flag instead of any admin role.
  • The menu filter in ConsoleLayout was updated to match, so visibility and the backend lock agree.

Related Issue | 关联 Issue

N/A — discovered and verified during on-prem deployment.

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

Verified in a live deployment: a global admin still sees 资源管理; a team admin no longer sees the dead menu entry (previously shown with the lock banner).

Additional Notes | 其他说明

  • No regression test included — the change is a front-end menu-visibility fix; happy to add one if the maintainers want it for the panel.
  • Commits carry DCO Signed-off-by trailers.

@escaleraalcielo
escaleraalcielo force-pushed the fix/resource-lock-global-admin branch 2 times, most recently from 5eeeab8 to 70fcde9 Compare August 9, 2026 05:57
useCurrentRole() returns the team-level role, which the backend forces to
'admin' for team owners, so normal users who own a team were wrongly
treated as global admins: ResourcePage showed AdminResourceLock, the
route guard redirected away from /code, and ConsoleLayout hid the
asset-management group (against a group name that never matched).

Use isGlobalAdmin(auth.user, auth.isAdmin) in all three places, matching
the documented model that the resource lock applies only to global
system_admin users.

Signed-off-by: Daniel Martínez <escaleraalcielo06@gmail.com>
@escaleraalcielo
escaleraalcielo force-pushed the fix/resource-lock-global-admin branch 3 times, most recently from 68e23e9 to 12f360b Compare August 9, 2026 15:47
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thanks for your contribution and attention! We will review this PR and get back to you as soon as possible.

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.

2 participants