Rest 更改Magento 2.1来宾权限以访问web api目录/产品
我想更改匿名角色(来宾)的权限设置,以便在没有任何身份验证的情况下可以查看所有产品Rest 更改Magento 2.1来宾权限以访问web api目录/产品,rest,api,magento,magento2,user-permissions,Rest,Api,Magento,Magento2,User Permissions,我想更改匿名角色(来宾)的权限设置,以便在没有任何身份验证的情况下可以查看所有产品 http://magento.dev/rest/V1/products 我理解,我可以编辑: /magento/vendor/magento/module-catalog/etc/webapi.xml 允许匿名访问,但这似乎有点骇人听闻 当我尝试此端点时: http://magento.dev/rest/V1/products 我得到以下结果: { "message": "Consumer is not
http://magento.dev/rest/V1/products
我理解,我可以编辑:
/magento/vendor/magento/module-catalog/etc/webapi.xml
允许匿名访问,但这似乎有点骇人听闻
当我尝试此端点时:
http://magento.dev/rest/V1/products
我得到以下结果:
{
"message": "Consumer is not authorized to access %resources",
"parameters": {
"resources": "Magento_Catalog::products"
}
}
我是Magento的新手,所以可能RESTAPI的这种方法是错误的,还有另一种方法可以在没有提升权限的情况下检索JSON格式的产品列表
提前感谢。在Magento 2.1中。对许多端点的匿名访问受到限制。您可以禁用此限制 要禁用此功能,请登录到管理面板,然后导航到存储>配置>服务>Magento Web API>Web API安全。然后从允许匿名访客访问菜单中选择是