sails.config.policies
此配置是一個字典,將政策 (policies) 對應到應用程式的動作 (actions)。請參閱概念 > 政策 以取得更多資訊。
屬性 | 類型 | 預設值 | 詳細資訊 |
---|---|---|---|
(任何字串) | _或_ |
不適用 | 新增至 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
}
}