Skip to content

fix:TAP-10535 When assigning permissions to a role, for connections a…#3092

Open
weiliang110100 wants to merge 1 commit intodevelopfrom
fix-TAP-10535-develop
Open

fix:TAP-10535 When assigning permissions to a role, for connections a…#3092
weiliang110100 wants to merge 1 commit intodevelopfrom
fix-TAP-10535-develop

Conversation

@weiliang110100
Copy link
Contributor

…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.

…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.
@augmentcode
Copy link

augmentcode bot commented Mar 19, 2026

🤖 Augment PR Summary

Summary: 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.
Changes: Updates UserServiceImpl.updatePermissionRoleMapping to persist only explicitly selected permission mappings (while still adding missing parent permissions).

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

biConsumer.accept(dto.getAdds(), (permissions, wholeRoleMappingDtos, roleId) -> {
// 只添加用户指定的权限,不自动添加子权限
List<RoleMappingDto> addRoleMappingDtos = dto.getAdds().stream()
.filter(r -> r.getRoleId().equals(roleId))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

1 participant