fix(panel): gate AdminResourceLock on global system_admin only - #883
Open
escaleraalcielo wants to merge 1 commit into
Open
fix(panel): gate AdminResourceLock on global system_admin only#883escaleraalcielo wants to merge 1 commit into
escaleraalcielo wants to merge 1 commit into
Conversation
escaleraalcielo
force-pushed
the
fix/resource-lock-global-admin
branch
2 times, most recently
from
August 9, 2026 05:57
5eeeab8 to
70fcde9
Compare
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
force-pushed
the
fix/resource-lock-global-admin
branch
3 times, most recently
from
August 9, 2026 15:47
68e23e9 to
12f360b
Compare
Collaborator
|
Thanks for your contribution and attention! We will review this PR and get back to you as soon as possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 globalsystem_adminonly, so regular team admins no longer see a menu entry that does nothing.修复 MemoryPanel 资源管理菜单的管理员锁定问题。此前「资源管理」菜单对任何包含
admin角色的用户(包括仅 Team 管理员)都会显示,点击后出现「资源管理功能暂未对管理员开放」的提示。现菜单仅对全局system_admin开放,普通团队管理员不再看到无功能的菜单项。AdminResourceLockis now computed from the global system admin flag instead of any admin role.ConsoleLayoutwas updated to match, so visibility and the backend lock agree.Related Issue | 关联 Issue
N/A — discovered and verified during on-prem deployment.
Change Type | 修改类型
Self-test Checklist | 自测清单
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 | 其他说明
Signed-off-bytrailers.