This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects

Intermediate commit: Fixed a bug with mapping definition during index

Closed Philipp Gritsch requested to merge 469-rebased-to-460 into development
Compare and
8 files
+ 112
21
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -375,6 +375,26 @@ public class GitlabService {
return groupApi.getSubGroups(groupId);
}
public boolean isMember(long gitProjectId, at.ac.uibk.gitsearch.domain.User user) throws GitLabApiException {
try {
org.gitlab4j.api.models.User gitUser = this.gitLabRepository.getAdminGitLabApi().getUserApi().getUserByEmail(user.getEmail());
if (gitUser == null) {
return false;
}
return gitLabRepository.getAdminGitLabApi().getProjectApi().getMember(gitProjectId, gitUser.getId(), true) != null;
} catch (final GitLabApiException e) {
if (e.getHttpStatus() == 404) {
return false;
}
throw e;
} catch (IllegalArgumentException e) {
// email of user invalid
return false;
}
}
/**
* Utility function used to set the default JGIT credentials to use the provided
* OAuth2 token