class PermissionInfo {
        private String id;

        private String name;

        private Set<String> actions = new HashSet<>();

        private List<Map<String, Object>> dataAccesses = new ArrayList<>();
    }

    public Authentication toAuthentication(DataAccessConfigBuilderFactory factory) {<FILL_FUNCTION_BODY>

        SimpleAuthentication authentication = new SimpleAuthentication();
        SimpleUser user = new SimpleUser();
        user.setId(id);
        user.setName(name);
        user.setUsername(username);
        user.setUserType(type);
        authentication.setUser(user);
        authentication.getDimensions().addAll(roles);
        List<Permission> permissionList = new ArrayList<>();

        permissionList.addAll(permissions.stream()
                .map(info -> {
                    SimplePermission permission = new SimplePermission();
                    permission.setId(info.getId());
                    permission.setName(info.getName());
                    permission.setActions(info.getActions());
                    permission.setDataAccesses(info.getDataAccesses()
                            .stream().map(conf -> factory.create()
                                    .fromMap(conf)
                                    .build()).collect(Collectors.toSet()));
                    return permission;

                })
                .collect(Collectors.toList()));

        permissionList.addAll(permissionsSimple.entrySet().stream()
                .map(entry -> {
                    SimplePermission permission = new SimplePermission();
                    permission.setId(entry.getKey());
                    permission.setActions(new HashSet<>(entry.getValue()));
                    return permission;
                }).collect(Collectors.toList()));

        authentication.setPermissions(permissionList);
        return authentication;
    
<no_super_class>