请问应用程序属性 cuba.rest.anonymousEnabled 在哪里设置

1559718450(1)

我在数据库里保存的 应用程序属性里是没找到。如何开启匿名rest访问

你好,
放到 web-app.properteis 属性文件中

1559720299(1) 我放了 报出这个错误 Reading forbidden

看样子是没有读这个实体权限,你给匿名用户配置权限了吗。
https://doc.cuba-platform.cn/manual-7.0-chs/rest_api_v2_anonymous.html

1559722586 1559722610(1)1559722950(1) 配置了也还是一样的错误
{
“error”: “Reading forbidden”,
“details”: “Reading of the sdbmtsample$Store is forbidden”
}

已解决了。重启下可以了

权限必须重启才能生效么?

如果不是所有的方法都允许匿名的话,可以单独配置给某个方法, anonymousAllowed="true"

        <method name="scanEQPQRCode" anonymousAllowed="true">
            <param name="eqpUnitId"/>
            <param name="currentGpsData"/>
        </method>

你说的这个是配置在哪里?web目录下的rest-services.xml里吗?

一般是这个文件,它是在web-app.properties里面指定的。就是你把service转成rest api的那个配置文件。

cuba.rest.servicesConfig = +cn/com/comany/rest-services.xml

1 个赞

A post was split to a new topic: cuba studio生成的react前端请求rest接口的时候用什么