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

Skip to content
Snippets Groups Projects
Commit f6b74f65 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Merge branch '517-sharing-group-teacher-is-not-acknowledge-for-access' into 'development'

Resolve "Sharing: Group Teacher is not acknowledge for access"

See merge request !247
parents 3d718323 d5089feb
Branches
2 merge requests!248Planing April Release,!247Resolve "Sharing: Group Teacher is not acknowledge for access"
......@@ -196,6 +196,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.antMatchers("/api/exerciseFiles/**").permitAll()
.antMatchers("/api/exerciseChildren/**").permitAll()
.antMatchers("/api/exercise/**").permitAll()
.antMatchers("/api/exercises/source-authorization/**").permitAll()
.antMatchers("/api/exerciseFile/**").permitAll()
.antMatchers("/api/refreshToken").permitAll()
.antMatchers("/api/register").denyAll()
......
......@@ -305,7 +305,7 @@ public class SearchService {
GitLabApi gitLabApi = gitLabRepository.getGitLabApi(gitLabAccessInfo);
gitLabApi.getRepositoryApi().getRepositoryArchive(Long.toString(result.getProject().getProject_id()), "HEAD", ZIP);
} catch (GitLabApiException e) {
log.warn("GitLabApiException " + e.getMessage());
log.warn("filterArtemisActionForUnauthorized: GitLabApiException " + e.getMessage());
// We expect permissions missing
result.setSupportedActions(
result
......
......@@ -978,7 +978,7 @@ public class GitlabEventService {
tree = Optional.empty();
}
if (tree.isEmpty()) {
logger.info("project {} is not indexed. No metadata found", project.getId());
logger.info("project {} ({}) is not indexed. No metadata found", project.getNameWithNamespace(), project.getId());
return null;
}
boolean isMetadataMissing = false;
......@@ -991,7 +991,7 @@ public class GitlabEventService {
}
}
if ((isMetadataMissing || tree.get().getMetaDataInfo().getMetaData().isEmpty()) && !metadataMandatory) {
logger.info("project {} is not indexed. No metadata found", project.getId());
logger.info("project {} ({}) is not indexed. No metadata found", project.getNameWithNamespace(), project.getId());
return null;
}
if (tree.get().hasErrors()) {
......@@ -1002,7 +1002,7 @@ public class GitlabEventService {
.stream()
.map(e -> String.format("%s: %s", e.getKey(), e.getValue().stream().collect(Collectors.joining(", "))))
.collect(Collectors.joining("\\n"));
logger.info("project {} has errors and is not indexed: {}", project.getId(), errors);
logger.info("project {} ({}) has errors and is not indexed: {}", project.getNameWithNamespace(), project.getId(), errors);
} else {
if (logger.isDebugEnabled()) {
logger.debug("parsed tree:");
......
......@@ -396,7 +396,7 @@ public class ExerciseResource {
return ResponseEntity.ok(new URL(baseUrl + "/import/" + exerciseImportService.getTokenFromUrl(exerciseUrl)).toURI());
}
@GetMapping("/exercises/{id}/source-authorization")
@GetMapping("/exercises/source-authorization/{id}")
@SuppressWarnings("PMD.AvoidCatchingGenericException")
public ResponseEntity<SearchResultDTO> getMembers(@PathVariable("id") String exerciseId) {
try {
......
......@@ -39,7 +39,7 @@ export class ExerciseService {
public hasUserAccessToGitlabRepo(exerciseId: string): Observable<boolean> {
const endpoint: string = this.applicationConfigService.getEndpointFor(
SERVER_API_URL + 'api/exercises/' + encodeURIforExerciseId(exerciseId) + '/source-authorization'
SERVER_API_URL + 'api/exercises/source-authorization/' + encodeURIforExerciseId(exerciseId)
);
return this.http.get<any>(endpoint, { observe: 'response' }).pipe(
map((response: HttpResponse<any>) => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment