Software Development, Programming, Self Improvement, Java, Spring Boot.
@PreAuthorize("hasRole('ROLE_ADMIN')") public ResponseEntity<ApiResponseDto<?>> AdminDashboard() { return ResponseEntity .status(HttpStatus.OK) .body(ApiResponseDto.builder() .isSuccess(true) .message("Admin dashboard!") .build()); } // Only users with 'ROLE_SUPER_ADMIN' role can access this end