Skip to content

Commit

Permalink
Fix owner
Browse files Browse the repository at this point in the history
Signed-off-by: muralibasani <[email protected]>
  • Loading branch information
muralibasani committed Nov 13, 2023
1 parent d02ae36 commit 71426b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public ApiResponse uploadSchema(
getPrincipal(), PermissionType.REQUEST_CREATE_SCHEMAS)) {
return ApiResponse.NOT_AUTHORIZED;
}
schemaRequest.setRequestor(userName);

int tenantId = commonUtilsService.getTenantId(getUserName());
Optional<Env> schemaEnv = getSchemaEnvFromKafkaEnvId(schemaRequest.getEnvironment());
Expand Down Expand Up @@ -542,7 +543,6 @@ public ApiResponse uploadSchema(
}
}

schemaRequest.setRequestor(userName);
SchemaRequest schemaRequestDao = new SchemaRequest();
copyProperties(schemaRequest, schemaRequestDao);
schemaRequestDao.setReq_no(schemaRequest.getRequestId());
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/java/io/aiven/klaw/TopicAclControllerIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ public void editSchemaRequestFailureNotOwnerOfRequest() throws Exception {
SchemaRequestModel schemaRequest = new SchemaRequestModel();
schemaRequest.setRequestId(schemaRequestId);
schemaRequest.setTopicname(schemaRequestsResponseModel.getTopicname());
schemaRequest.setRequestor(user3);
schemaRequest.setRequestor(user2);
schemaRequest.setEnvironment(schemaRequestsResponseModel.getEnvironment());
schemaRequest.setForceRegister(schemaRequestsResponseModel.getForceRegister());
schemaRequest.setSchemafull(schemaRequestsResponseModel.getSchemafull());
Expand All @@ -1350,7 +1350,7 @@ public void editSchemaRequestFailureNotOwnerOfRequest() throws Exception {
.thenReturn(responseResponseEntity);
mvc.perform(
MockMvcRequestBuilders.post("/uploadSchema")
.with(user(user1).password(PASSWORD).roles("USER"))
.with(user(user2).password(PASSWORD).roles("USER"))
.content(jsonReq)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
Expand Down

0 comments on commit 71426b0

Please sign in to comment.