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

Skip to content
Snippets Groups Projects
Commit fbce5b4d authored by Eduard Frankford's avatar Eduard Frankford
Browse files

bug fix

parent ed1ec5d9
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -220,6 +220,12 @@ public class UserResource {
return ResponseUtil.wrapOrNotFound(userService.getUserWithAuthoritiesByLogin(login).map(AdminUserDTO::new));
}
@GetMapping("/user")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.USER + "\")")
public ResponseEntity<AdminUserDTO> getUser() {
return ResponseUtil.wrapOrNotFound(userService.getUserWithAuthorities().map(AdminUserDTO::new));
}
/**
* {@code DELETE /admin/users/:login} : delete the "login" User.
*
......
......@@ -41,7 +41,7 @@ export class PeerReviewingComponent implements OnInit {
getUserFromLogin(): void {
if (this.currentAccount != null && this.currentAccount.login != null) {
this.userService.find(this.currentAccount?.login).subscribe(val => {
this.userService.getLoggedInUser().subscribe(val => {
this.user = val;
});
}
......
......@@ -29,6 +29,10 @@ export class UserManagementService {
return this.http.get<IUser>(`${this.resourceUrl}/${login}`);
}
getLoggedInUser(): Observable<IUser> {
return this.http.get<IUser>('api/admin/user');
}
query(req?: Pagination): Observable<HttpResponse<IUser[]>> {
const options = createRequestOption(req);
return this.http.get<IUser[]>(this.resourceUrl, { params: options, observe: 'response' });
......
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