fix: member-created services shouldn't be applied to admin resources (#1113)

This commit is contained in:
UUBulb
2025-08-28 22:37:44 +08:00
committed by GitHub
parent 61b8411d06
commit b6fed87d61
8 changed files with 27 additions and 21 deletions

View File

@@ -142,14 +142,14 @@ func checkStatus() {
for _, server := range m {
// 监测点
UserLock.RLock()
var role uint8
if u, ok := UserInfoMap[server.UserID]; !ok {
var role model.Role
if u, ok := UserInfoMap[alert.UserID]; !ok {
role = model.RoleMember
} else {
role = u.Role
}
UserLock.RUnlock()
if alert.UserID != server.UserID && role != model.RoleAdmin {
if alert.UserID != server.UserID && !role.IsAdmin() {
continue
}
alertsStore[alert.ID][server.ID] = append(alertsStore[alert.