From f4a9f937fbea659f4c38dd8ab799489d836843d2 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Thu, 12 Nov 2026 10:59:15 +0100 Subject: [PATCH 1/2] fix(authz): bundle labels as the portal names them; last admin message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The catalogue named CXO "Geschäftsleitung" and OWNER "Inhaber des Arbeitsbereichs", while the portal shows "Geschäftsführung" and "Inhaberschaft". The catalogue now takes the portal's names (version 2026-11-12.1), which also keeps the role "Geschäftsführung" apart from the company function "Geschäftsleitung" of the role dataset. The last-admin refusal named only IT_ADMIN; the guard holds for OWNER too, so the message now says "the last administrator (IT_ADMIN or OWNER)". Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf --- internal/authz/catalogue.go | 12 +++++++----- internal/server/team.go | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/authz/catalogue.go b/internal/authz/catalogue.go index 6b132b1..36bd423 100644 --- a/internal/authz/catalogue.go +++ b/internal/authz/catalogue.go @@ -23,7 +23,7 @@ import "strings" // Version names this catalogue; it changes with every change of a // capability, bundle or position. -const Version = "2026-11-11.1" +const Version = "2026-11-12.1" // Products a capability belongs to. const ( @@ -143,10 +143,12 @@ func join(groups ...[]string) []string { // grant them on 2026-11-10; then the new ones of variant L and EXTERNAL. var Bundles = []Bundle{ {Code: "IT_ADMIN", Label: "IT-Administration", Assignable: true, Capabilities: join(adminPortal, adminWerkmeister, adminRegistry)}, - // OWNER has IT_ADMIN's rights. The portal does not know OWNER yet; it - // will show it like IT_ADMIN (step 2, decided 2026-11-10). - {Code: "OWNER", Label: "Inhaber des Arbeitsbereichs", Assignable: true, Capabilities: join(adminPortal, adminWerkmeister, adminRegistry)}, - {Code: "CXO", Label: "Geschäftsleitung", Assignable: true, Capabilities: join(member, []string{ + // OWNER has IT_ADMIN's rights; the portal shows it like IT_ADMIN (decided + // 2026-11-10). Bundle labels are the portal's German role names, so the + // role "Geschäftsführung" (CXO) stays apart from the company function + // "Geschäftsleitung" (r1.geschaeftsleitung) of the role dataset. + {Code: "OWNER", Label: "Inhaberschaft", Assignable: true, Capabilities: join(adminPortal, adminWerkmeister, adminRegistry)}, + {Code: "CXO", Label: "Geschäftsführung", Assignable: true, Capabilities: join(member, []string{ "portal:products.view", "portal:projects.view", "portal:profile.view", "portal:billing.view", "portal:audit.view", "portal:catalog.view", "portal:documents.view", "portal:store.view", "portal:contracts.view", "portal:infra.view", "portal:studio.view", "portal:profile.edit", "portal:store.upload", "portal:projects.edit", diff --git a/internal/server/team.go b/internal/server/team.go index 9472323..798a3b1 100644 --- a/internal/server/team.go +++ b/internal/server/team.go @@ -260,7 +260,7 @@ func (s *Server) changeRole(ctx context.Context, w http.ResponseWriter, r *http. return } if !isAdminRole([]string{role}) && lastActiveAdmin(members, m) { - writeError(w, http.StatusConflict, "last_admin", "the last IT_ADMIN of a workspace cannot be demoted") + writeError(w, http.StatusConflict, "last_admin", "the last administrator (IT_ADMIN or OWNER) of a workspace cannot be demoted") return } if err := s.Keycloak.SetMemberRole(ctx, m.UserID, role); err != nil { @@ -278,7 +278,7 @@ func (s *Server) setBlocked(ctx context.Context, w http.ResponseWriter, r *http. return } if blocked && lastActiveAdmin(members, m) { - writeError(w, http.StatusConflict, "last_admin", "the last IT_ADMIN of a workspace cannot be blocked") + writeError(w, http.StatusConflict, "last_admin", "the last administrator (IT_ADMIN or OWNER) of a workspace cannot be blocked") return } if err := s.Keycloak.SetMemberBlocked(ctx, m.UserID, t.ID, blocked); err != nil { @@ -323,7 +323,7 @@ func (s *Server) deleteMember(w http.ResponseWriter, r *http.Request, resolve te return } if lastActiveAdmin(members, m) { - writeError(w, http.StatusConflict, "last_admin", "the last IT_ADMIN of a workspace cannot be removed") + writeError(w, http.StatusConflict, "last_admin", "the last administrator (IT_ADMIN or OWNER) of a workspace cannot be removed") return } -- 2.54.1 From be955748475563e552fde8b7e9d787372e6921fd Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Thu, 12 Nov 2026 11:14:15 +0100 Subject: [PATCH 2/2] ci: run the tests uncached so the coverage total is complete With the runner's test cache, packages marked "(cached)" left their share out of cover.out and the total fell under the 70% gate, while the same code passed on a run without cached results (main dd94763: every package run, gate passed; PR #126: six packages cached, gate failed twice with the same per-package numbers). -count=1 runs them all. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf --- .gitea/workflows/ci.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index d42e266..30b3bd4 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -82,8 +82,11 @@ jobs: # harness against both Memory and Postgres, so we don't need its # own test binary — and including it triggers a covdata-tool error # on packages with no _test.go files. -coverpkg makes the server's - # exercise of store/* count toward coverage. - run: go test -race -coverpkg=./internal/... -coverprofile=cover.out ./internal/server/... ./internal/config/... ./internal/keycloak/... ./internal/llmkeys/... ./internal/erpsetup/... ./internal/scopes/... ./internal/secretbox/... ./internal/roles/... ./internal/telemetry/... ./internal/legal/... + # exercise of store/* count toward coverage. -count=1: a cached + # package result leaves its share out of cover.out, so the total + # dropped below the gate whenever the runner had cached results + # (main 2026-11-12 08:55 passed uncached; PR #126 failed cached). + run: go test -count=1 -race -coverpkg=./internal/... -coverprofile=cover.out ./internal/server/... ./internal/config/... ./internal/keycloak/... ./internal/llmkeys/... ./internal/erpsetup/... ./internal/scopes/... ./internal/secretbox/... ./internal/roles/... ./internal/telemetry/... ./internal/legal/... - name: coverage gate run: | -- 2.54.1