fix:TAP-10535 When assigning permissions to a role, for connections a…#3092
fix:TAP-10535 When assigning permissions to a role, for connections a…#3092weiliang110100 wants to merge 1 commit intodevelopfrom
Conversation
…nd tasks, if you only select the page permission at the very front, after saving, the subsequent view, edit, delete permissions, as well as the view all data permission, will all be automatically selected.
🤖 Augment PR SummarySummary: Fixes role permission assignment so selecting only the leading page/menu permission for Connections/Tasks doesn’t cause view/edit/delete and “view all data” permissions to be auto-selected after save. 🤖 Was this summary useful? React with 👍 or 👎 |
| biConsumer.accept(dto.getAdds(), (permissions, wholeRoleMappingDtos, roleId) -> { | ||
| // 只添加用户指定的权限,不自动添加子权限 | ||
| List<RoleMappingDto> addRoleMappingDtos = dto.getAdds().stream() | ||
| .filter(r -> r.getRoleId().equals(roleId)) |
There was a problem hiding this comment.
r.getRoleId().equals(roleId) can throw an NPE if any incoming RoleMappingDto has a null roleId (and it would be grouped under a null roleId as well). Consider making this role-id comparison null-safe to avoid a hard failure on unexpected/invalid input.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
…nd tasks, if you only select the page permission at the very front, after saving, the subsequent view, edit, delete permissions, as well as the view all data permission, will all be automatically selected.