小编Ari*_*rif的帖子

将参数传递给sails.js策略

Sails.js(0.9v)控制器的策略定义为:

RabbitController:{

    '*': false, 

    nurture    : 'isRabbitMother',

    feed : ['isNiceToAnimals', 'hasRabbitFood']
}
Run Code Online (Sandbox Code Playgroud)

有没有办法将params传递给这些acls,例如:

RabbitController:{

    '*': false, 

    nurture    : 'isRabbitMother(myparam)',

    feed : ['isNiceToAnimals(myparam1, myparam2)', 'hasRabbitFood(anotherParam)']
}
Run Code Online (Sandbox Code Playgroud)

这可能会导致这些函数多次用于不同的参数.谢谢Arif

parameters acl controllers policies sails.js

10
推荐指数
1
解决办法
3105
查看次数

标签 统计

acl ×1

controllers ×1

parameters ×1

policies ×1

sails.js ×1