use of com.google.gerrit.server.group.MemberResource in project gerrit by GerritCodeReview.
the class MembersCollection method parse.
@Override
public MemberResource parse(GroupResource parent, IdString id) throws NotInternalGroupException, AuthException, ResourceNotFoundException, IOException, ConfigInvalidException {
GroupDescription.Internal group = parent.asInternalGroup().orElseThrow(NotInternalGroupException::new);
IdentifiedUser user = accounts.parse(TopLevelResource.INSTANCE, id).getUser();
if (parent.getControl().canSeeMember(user.getAccountId()) && isMember(group, user)) {
return new MemberResource(parent, user);
}
throw new ResourceNotFoundException(id);
}
Aggregations