自定义控制器返回403错误

按照Jmix文档中关于自定义控制器的写法:

package com.gense.ips.controller;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/orders")
public class RestTest {
    @GetMapping("/calculateTotalAmount")
    public ResponseEntity<Integer> calculateTotalAmount() {

        return ResponseEntity
                .status(HttpStatus.OK)
                .header(HttpHeaders.CACHE_CONTROL, "max-age=31536000")
                .body(10);

    }
}

访问时返回403错误:
image

没有使用自定义控制保护。

403 表示无权限访问。

确保安装了 REST 扩展组件并设置:

jmix.rest.anonymous-url-patterns=/orders/**