fix(mobile-api): read roles services-system sends as bare ids
services-system writes a role already seen in a response as its bare id. The module check missed it, so a role granted two modules was refused the second; the super-admin target guard now reads it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
4c48ebea2e
commit
69e2b4eb7b
4 files changed
+22
-3
No files matched your search
+7
@@ -500,6 +500,13 @@ class AdminUserServiceTest {
|
||||
verify(auth, never()).resetAdminPassword(anyString(), anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void nonSuperCaller_cannotManageSuperAdminTargetEvenWhenTheRoleArrivesAsABareId() {
|
||||
stubFind(6, userWithRoles(6, "Root", 1));
|
||||
assertCoded(() -> service.resetPassword(6L), HttpStatus.FORBIDDEN, "SUPER_ADMIN_REQUIRED");
|
||||
verify(auth, never()).resetAdminPassword(anyString(), anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void superCaller_canManageSuperAdminTarget() {
|
||||
callerIsSuper();
|
||||
|
||||
Reference in new issue
Block a user