mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-30 14:30:08 +08:00
remove unnecessary check
Signed-off-by: MiniDigger <admin@benndorf.dev>
This commit is contained in:
parent
23d5e953c2
commit
a774a8acdd
@ -149,12 +149,10 @@ public class OrganizationController extends HangarComponent {
|
||||
@LoggedIn
|
||||
@GetMapping(path = "/{user}/userOrganizationsVisibility", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Boolean>> getUserOrganizationMembershipVisibility(@PathVariable String user) {
|
||||
Optional<HangarPrincipal> principal = getOptionalHangarPrincipal();
|
||||
if (principal.isPresent()) {
|
||||
if (principal.get().getName().equals(user) || principal.get().isAllowedGlobal(Permission.SeeHidden)) {
|
||||
HangarPrincipal principal = getHangarPrincipal();
|
||||
if (principal.getName().equals(user) || principal.isAllowedGlobal(Permission.SeeHidden)) {
|
||||
return ResponseEntity.ok(memberService.getUserOrganizationMembershipVisibility(user));
|
||||
}
|
||||
}
|
||||
throw new HangarApiException(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user