fix(authz): bundle labels as the portal names them; last admin message #126
No files matched your search
@@ -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: |
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user