#36936: feat(roles): add PUT /v1/roles/{roleId} for role update - #37012
Open
hassandotcms wants to merge 3 commits into
Open
#36936: feat(roles): add PUT /v1/roles/{roleId} for role update#37012hassandotcms wants to merge 3 commits into
hassandotcms wants to merge 3 commits into
Conversation
…eparent * New v1 REST endpoint replacing DWR RoleAjax#updateRole for the Angular Roles & Tools portlet (epic #36909): updates name, key, description, can-grant flags and parent; null parentRoleId reparents to root (DWR parity) * Guards: 404 missing role/parent, 403 system/locked roles, 400 invalid name and reparent cycles (net-new corruption guard), 409 duplicate key/name * Auth: backend user + roles portlet + CMS admin, shared gate extracted and reused by POST /v1/roles (behavior unchanged, regression-tested) * RoleHelper promoted to @ApplicationScoped CDI with the update logic under @WrapInTransaction; response reuses RoleView/ResponseEntityRoleDetailView (same shape as GET /v1/roles/{roleid}) * 15 integration tests (TDD red->green), registered in MainSuite3a * Regenerated openapi.yaml
Contributor
|
Claude finished @hassandotcms's task in 3m 1s —— View job Code Review: PUT /v1/roles/{roleId}I reviewed the diff ( Verified correct:
New Issues
Existing
Overall this is a clean, well-tested addition. No blocking issues — the two items above are non-blocking polish. |
hassandotcms
marked this pull request as ready for review
August 11, 2026 15:57
6 tasks
…th a test * OpenAPI description now spells out that PUT overwrites every field: omitted booleans reset to false, omitted roleKey/description are cleared, omitted parentRoleId reparents to root (DWR parity) * New IT testUpdateRole_fullReplace_omittedFieldsAreReset pins the contract so drift to merge/PATCH semantics is a deliberate, test-breaking change * Addresses claude[bot] review finding on PR #37012
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
PUT /api/v1/roles/{roleId}— update role name, key, description, can-grant flags,and parent. Replaces DWR
RoleAjax#updateRole(Angular portlet migration, Dojo to Angular: Roles and Tools Portlet #36909)parentRoleId: null→ role becomes root (DWR parity)POST /v1/roles; stricterthan DWR's users-portlet check — intentional). Gate extracted, shared with POST
ResponseEntityRoleDetailView, same shape asGET /v1/roles/{roleid}RoleHelper→@ApplicationScopedCDI; update logic@WrapInTransactionopenapi.yamlChecklist
RoleResourceIntegrationTest(MainSuite3a): all field updates,reparent to other/root/self/cycle, 403/404/409 cases, POST create regression
Fixes #36936