Require :
otorisasi login dengan spring security
crud
Java
Copy
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class KonfigurasiSecurity extends WebSecurityConfigurerAdapter{}
Java
Copy
@RestController
@RequestMapping("/api/harga")
public class HargaRestController {
@Autowired private HargaDao hargaDao;
@PreAuthorize("hasAuthority('HARGA_EDIT')")
@GetMapping("/")
public Page<Harga> daftarHarga(Pageable page){
return hargaDao.findAll(page);
}
}