fix: Add user permission in the response for update datasource api (#18629)
This commit is contained in:
parent
4345e29dc5
commit
74dddd4701
|
|
@ -333,7 +333,8 @@ public class DatasourceServiceCEImpl extends BaseService<DatasourceRepository, D
|
|||
savedDatasource.setPluginName(unsavedDatasource.getPluginName());
|
||||
return savedDatasource;
|
||||
});
|
||||
});
|
||||
})
|
||||
.flatMap(repository::setUserPermissionsInObject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -392,7 +392,13 @@ public class DatasourceServiceTest {
|
|||
assertThat(createdDatasource.getPluginId()).isEqualTo(datasource.getPluginId());
|
||||
assertThat(createdDatasource.getName()).isEqualTo(datasource.getName());
|
||||
assertThat(createdDatasource.getDatasourceConfiguration().getConnection().getSsl().getKeyFile().getName()).isEqualTo("ssl_key_file_id2");
|
||||
|
||||
assertThat(createdDatasource.getUserPermissions()).isNotEmpty();
|
||||
assertThat(createdDatasource.getUserPermissions()).containsAll(
|
||||
Set.of(
|
||||
READ_DATASOURCES.getValue(), EXECUTE_DATASOURCES.getValue(),
|
||||
MANAGE_DATASOURCES.getValue(), DELETE_DATASOURCES.getValue()
|
||||
)
|
||||
);
|
||||
})
|
||||
.verifyComplete();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user