Skip to content

Commit

Permalink
catalog: test with simplifyPermissions configuration, #TASK-4158
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Nov 16, 2023
1 parent 6af436b commit 2045340
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,24 @@ public void getEffectivePermissions() throws CatalogException {
Arrays.asList("user", "user3", "user6"), Collections.singletonList("user"),
Arrays.asList("user", "user2", "user3", "user5", "user6", ParamConstants.ANONYMOUS_USER_ID), Arrays.asList("user", "user3", "user6"), Collections.singletonList("user"),
Arrays.asList("user", "user2", "user3", "user5", "user6", ParamConstants.ANONYMOUS_USER_ID), Arrays.asList("user4", "user7"), aclList.getResults().get(2));

catalogManager.getConfiguration().getOptimizations().setSimplifyPermissions(true);
aclList = catalogManager.getAdminManager().getEffectivePermissions(studyFqn, Arrays.asList(s_1, s_2, s_3),
Enums.Resource.SAMPLE.name(), token);
assertEquals(3, aclList.getNumResults());
assertPermissions("s_1", Arrays.asList("user", "user2", "user3", "user4", "user5", "user6", "user7", ParamConstants.ANONYMOUS_USER_ID),
Arrays.asList("user", "user2", "user6", "user7"), Collections.singletonList("user"),
Arrays.asList("user", "user5", "user6", ParamConstants.ANONYMOUS_USER_ID), Arrays.asList("user", "user6"), Collections.singletonList("user"),
Arrays.asList("user", "user5", "user6", ParamConstants.ANONYMOUS_USER_ID), Collections.emptyList(), aclList.getResults().get(0));
assertPermissions("s_2", Arrays.asList("user", "user2", "user4", "user5", "user6", "user7", ParamConstants.ANONYMOUS_USER_ID),
Arrays.asList("user", "user2", "user6", "user7"), Collections.singletonList("user"),
Arrays.asList("user", "user5", "user6", ParamConstants.ANONYMOUS_USER_ID), Arrays.asList("user", "user6"), Collections.singletonList("user"),
Arrays.asList("user", "user5", "user6", ParamConstants.ANONYMOUS_USER_ID), Collections.singletonList("user3"), aclList.getResults().get(1));
assertPermissions("s_3", Arrays.asList("user", "user2", "user3", "user4", "user5", "user6", "user7", ParamConstants.ANONYMOUS_USER_ID),
Arrays.asList("user", "user3", "user6"), Collections.singletonList("user"),
Arrays.asList("user", "user2", "user3", "user4", "user5", "user6", "user7", ParamConstants.ANONYMOUS_USER_ID), Arrays.asList("user", "user3", "user6"), Collections.singletonList("user"),
Arrays.asList("user", "user2", "user3", "user4", "user5", "user6", "user7", ParamConstants.ANONYMOUS_USER_ID), Collections.emptyList(), aclList.getResults().get(2));

}

private void assertPermissions(String id, List<String> view, List<String> write, List<String> delete, List<String> viewAnnots,
Expand Down

0 comments on commit 2045340

Please sign in to comment.