编辑页面

sails.config.policies

此配置是一个字典,它将 策略 映射到应用程序的 操作。有关更多信息,请参阅 概念 > 策略

属性

#
属性 类型 默认值 详细信息
(任何字符串) String
_或_
Dictionary
n/a 添加到 sails.config.policies 的任何属性将被解释为策略到控制器或一组独立操作的映射。

示例

#
module.exports.policies = {

  '*': 'isLoggedIn', // Require user to be logged in to access any action not otherwise mapped in this config
  'UserController': {
    'login': true    // Always allow access to the user login action
  }


}

是否缺少某些内容?

如果您发现我们遗漏或可以改进的内容,请按照 此链接 并向 sails 仓库提交拉取请求。在我们合并后,更改将在网站下次部署时反映在网站上。

参考

参考