Ruby on rails 声明式授权-语法

Ruby on rails 声明式授权-语法,ruby-on-rails,declarative-authorization,Ruby On Rails,Declarative Authorization,如果第一行或第二行属性上的两个属性都为true,那么这是表示权限应允许读取访问的正确方式吗?多谢各位 has_permission_on :grant do to => :read if_attribute { :grant_application_opens < Date.today :join_by => :and :grant_application_closes > Date.today } if_attribut

如果第一行或第二行属性上的两个属性都为true,那么这是表示权限应允许读取访问的正确方式吗?多谢各位

has_permission_on :grant do
      to => :read
      if_attribute { :grant_application_opens < Date.today :join_by => :and       :grant_application_closes > Date.today } 
      if_attribute :grant_application_enduring => true
      end
拥有以下权限:授予do
to=>:读取
如果属性{:grant\u application\u opens:and:grant\u application\u closes>Date.today}
if_属性:grant_application_persisteng=>true
结束

如果您想确保它做了您想要的事情,请为它编写一个测试。这叫做探索性测试。谢谢-我知道上面的说法不正确-但我找不到如何纠正错误。