private void manageRolePermission(final String roleId, final List<String> currentPermissionList) {
        List<String> lastPermissionList = permissionMapper.findByObjectId(roleId)
                .stream()
                .map(PermissionDO::getResourceId)
                .collect(Collectors.toList());
        List<String> addPermission = getListDiff(lastPermissionList, currentPermissionList);
        if (CollectionUtils.isNotEmpty(addPermission)) {
            batchSavePermission(addPermission.stream()
                    .map(node -> PermissionDO.buildPermissionDO(PermissionDTO
                            .builder()
                            .objectId(roleId)
                            .resourceId(node)
                            .build()))
                    .collect(Collectors.toList()));
        }
        
        List<String> deletePermission = getListDiff(currentPermissionList, lastPermissionList);
        if (CollectionUtils.isNotEmpty(deletePermission)) {
            deletePermission.forEach(node -> deleteByObjectIdAndResourceId(new PermissionQuery(roleId, node)));
        }
    }
manger role permission.

@param roleId role id.
@param currentPermissionList {@linkplain List} current role permission ids
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/PermissionServiceImpl.java