Skip to content

Feature/conluz 174#175

Open
viktorKhan wants to merge 11 commits into
mainfrom
feature/conluz-174
Open

Feature/conluz 174#175
viktorKhan wants to merge 11 commits into
mainfrom
feature/conluz-174

Conversation

@viktorKhan

Copy link
Copy Markdown
Contributor

No description provided.

viktorKhan and others added 2 commits June 10, 2026 13:12
…lege

The community access guard and context filter authorized platform-level
operations using the obsolete users.role == ADMIN, making the legacy column
an authorization input. Source platform privilege exclusively from
User.isPlatformAdmin() across the guard, the community context filter, and the
two remaining authorization reads (CreateUserServiceImpl, GetSuppliesByUserIdController).

Adds an escalation test proving a user with role=ADMIN but isPlatformAdmin=false
and no memberships receives no platform grants and is denied community operations.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
With platform privilege now sourced exclusively from is_platform_admin, the
legacy users.role column and Role enum are dead authorization weight. Remove
them from the domain User, UserEntity, mappers, the user request/response DTOs
and CSV import, and the bootstrap lookup (now findFirstByNumber). Add a Liquibase
changeset dropping the column, wired after the membership backfill that reads it.

JWT 'role' claim dropped: no backend reader existed (getRole(Token) had no
callers); removed the claim, JwtAuthRepository.getRole and AuthRepository.getRole.

BREAKING API CHANGE: 'role' is no longer accepted in create/update user requests
or the CSV import, and is no longer returned in user responses. Because
fail-on-unknown-properties is enabled, clients still sending 'role' will receive
400 — the frontend must be updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@viktorKhan viktorKhan linked an issue Jun 10, 2026 that may be closed by this pull request
23 tasks
viktorKhan and others added 9 commits June 10, 2026 17:32
…ization

The @operation descriptions still referenced the obsolete "Required Role: ADMIN"
from the pre-multi-community model. Align them with the actual @PreAuthorize guards:
- canManageCommunity/Plant/SharingAgreement, canEditUser, canCreateUserIn,
  canManageMemberships -> "Required: Platform Admin or Community Admin"
- canEditSupply -> "Required: Platform Admin, Community Admin, or the supply owner"
- canReadUser -> "Required: Platform Admin, Community Admin, or the user themselves"

Documentation only; no behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…talized in controllers layer. Enforced through arch tests and claude.md
…d by smaller interfaces to avoid having everything mixed and avoid this interface growing out of control
…#adminCommunityIds and #visibleCommunityIds methods.
…low get data from plants to all community members regarless of their role.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 6 — Hardening, isolation audit and closure

1 participant