【问题标题】:API JSON WS in liferay : only chosed json ws can workLiferay 中的 API JSON WS:只有选择的 json ws 才能工作
【发布时间】:2016-12-21 23:36:13
【问题描述】:

我有json.web.service.enabled=false,我不能更改它。

但我想用原生 json 获取我的 AssetCategory 和我的 AssetTags。那么是否可以只允许这 2 个 ws ?

我知道如果我将我的 json.web.service.enabled 设置为 true,我可以只允许经过身份验证的用户使用它。但是我可以限制对页面 api/jsonws 的访问权限吗???

感谢您的回答和帮助。

【问题讨论】:

  • 如果你“限制任何人访问页面 api/jsonws”,AssetCategory 和 AssetTags 是如何访问的?

标签: liferay liferay-6


【解决方案1】:

您可以在 portal-ext.properties 中使用以下门户属性来仅允许一组 Web 服务。

# # The property "jsonws.web.service.paths.includes" denotes patterns for JSON # web service action paths that are allowed. Set a blank pattern to allow # any service action path. # jsonws.web.service.paths.includes=

具体一点;为了使 AssetCategory 和 AssetTag 相关的 json ws,你会使用。 jsonws.web.service.paths.includes=/assetcategory/*,/assettag/*

【讨论】:

  • 谢谢,这是一个不错的选择。是否可能无法访问页面 api/jsonws ?
  • @DyM 我知道这是一个老问题,但也许答案会对不小心进入这个主题的人有所帮助;)您可以通过设置 jsonws.web.service.api 来禁用 api/jsonws 页面。如此处所述help.liferay.com/hc/en-us/articles/… 在您的portal-ext.properties 中的discoverable=false 但不幸的是它仅适用于7.0+
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-11
  • 2014-10-28
相关资源
最近更新 更多