mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
(improvement)(Headless) Fix model list auth checking (#883)
* (improvement)(Headless) Fix model list auth check * (improvement)(Headless) Fix row permission --------- Co-authored-by: jolunoluo
This commit is contained in:
@@ -39,7 +39,7 @@ public class SchemaAuthTest extends BaseTest {
|
||||
@Test
|
||||
public void test_getModelList_alice() {
|
||||
User user = DataUtils.getUserAlice();
|
||||
List<ModelResp> modelResps = modelService.getModelListWithAuth(user, 0L, AuthType.ADMIN);
|
||||
List<ModelResp> modelResps = modelService.getModelListWithAuth(user, null, AuthType.ADMIN);
|
||||
List<Long> expectedModelIds = Lists.newArrayList(1L, 4L);
|
||||
Assertions.assertEquals(expectedModelIds,
|
||||
modelResps.stream().map(ModelResp::getId).collect(Collectors.toList()));
|
||||
@@ -48,7 +48,7 @@ public class SchemaAuthTest extends BaseTest {
|
||||
@Test
|
||||
public void test_getVisibleModelList_alice() {
|
||||
User user = DataUtils.getUserAlice();
|
||||
List<ModelResp> modelResps = modelService.getModelListWithAuth(user, 0L, AuthType.VISIBLE);
|
||||
List<ModelResp> modelResps = modelService.getModelListWithAuth(user, null, AuthType.VISIBLE);
|
||||
List<Long> expectedModelIds = Lists.newArrayList(1L, 4L);
|
||||
Assertions.assertEquals(expectedModelIds,
|
||||
modelResps.stream().map(ModelResp::getId).collect(Collectors.toList()));
|
||||
@@ -75,7 +75,7 @@ public class SchemaAuthTest extends BaseTest {
|
||||
@Test
|
||||
public void test_getModelList_jack() {
|
||||
User user = DataUtils.getUserJack();
|
||||
List<ModelResp> modelResps = modelService.getModelListWithAuth(user, 0L, AuthType.ADMIN);
|
||||
List<ModelResp> modelResps = modelService.getModelListWithAuth(user, null, AuthType.ADMIN);
|
||||
List<Long> expectedModelIds = Lists.newArrayList(1L, 2L, 3L);
|
||||
Assertions.assertEquals(expectedModelIds,
|
||||
modelResps.stream().map(ModelResp::getId).collect(Collectors.toList()));
|
||||
|
||||
@@ -77,4 +77,4 @@ logging:
|
||||
|
||||
inMemoryEmbeddingStore:
|
||||
persistent:
|
||||
path: d://
|
||||
path: /tmp
|
||||
|
||||
Reference in New Issue
Block a user