fix(permission): 调整默认权限组与用户权限继承

- 将“普通用户”权限组纳入默认权限继承,创建和更新用户时自动合并其权限。
- 放宽“普通用户”系统组的可编辑性,但仍禁止删除;继续限制超级管理员组被修改。
- 更新管理端权限组操作状态,避免对不可删除或不可编辑项提供错误入口。
- 补充相关测试,覆盖默认权限组编辑、删除与用户权限继承场景。
This commit is contained in:
LanQin_
2026-06-22 14:42:37 +08:00
parent 8cbcc22a74
commit acdf298811
5 changed files with 106 additions and 17 deletions
@@ -127,8 +127,8 @@ func (a *App) handleUpdatePermissionGroup(w http.ResponseWriter, r *http.Request
respondError(w, http.StatusNotFound, "permission group not found")
return
}
if intBool(existingSystem) {
respondError(w, http.StatusForbidden, "system permission groups cannot be edited")
if id == PermissionGroupSuperAdmin {
respondError(w, http.StatusForbidden, "super administrator group cannot be edited")
return
}
var req struct {