use of com.google.gerrit.server.ExternalUser in project gerrit by GerritCodeReview.
the class ExternalUserPermissionIT method externalUser_isContainedInternalGroupThatContainsExternalGroup.
@Test
public void externalUser_isContainedInternalGroupThatContainsExternalGroup() {
AccountGroup.UUID internalGroup = groupOperations.newGroup().addSubgroup(EXTERNAL_GROUP).create();
ExternalUser user = createUserInGroup("1", "it-department");
assertThat(user.getEffectiveGroups().contains(internalGroup)).isTrue();
assertThat(user.getEffectiveGroups().contains(EXTERNAL_GROUP)).isTrue();
assertThat(user.getEffectiveGroups().contains(REGISTERED_USERS)).isTrue();
assertThat(user.getEffectiveGroups().contains(ANONYMOUS_USERS)).isTrue();
}
use of com.google.gerrit.server.ExternalUser in project gerrit by GerritCodeReview.
the class ExternalUserPermissionIT method externalUser_isContainedInRegisteredUsersIfConfigured.
@GerritConfig(name = "groups.includeExternalUsersInRegisteredUsersGroup", value = "true")
@Test
public void externalUser_isContainedInRegisteredUsersIfConfigured() {
ExternalUser user = createUserInGroup("1", "it-department");
assertThat(user.getEffectiveGroups().contains(REGISTERED_USERS)).isTrue();
}
use of com.google.gerrit.server.ExternalUser in project gerrit by GerritCodeReview.
the class ExternalUserPermissionIT method changeVisibility_changeOnBranchVisibleToRegisteredUsersIsVisible.
@Test
public void changeVisibility_changeOnBranchVisibleToRegisteredUsersIsVisible() throws Exception {
Change.Id changeId = changeOperations.newChange().project(project).create();
ExternalUser user = createUserInGroup("1", "it-department");
blockAnonymousRead();
permissionBackend.user(user).change(changeNotesFactory.create(project, changeId)).check(ChangePermission.READ);
}
Aggregations