Closed vittorius closed 8 years ago
Hi @vittorius!
The problem lies with this block
role :planner, proc { |user| user.planner? } do
can :read, Merchant
can :edit, Merchant
end
I assume that user.planner?
returns false for the admin user. Am I right?
Only the blocks that have truthy procs will be used in inheritance.
I see, the same inheritance principle must be honored in roles indication too. Thanks for the explanation.
No problem, I will state this in the readme to avoid future misunderstandings from others, thanks!
@pokonski Hello, Piotr. Something wrong goes with v1.0.4.
Policy file:
This way, admin cannot
:edit
a particular merchant (checking withauthorize! :edit, @merchant
) of even:read
Merchants.I change it to
and still no way for
:admin
to:read
or:edit
MerchantsThen I go with:
And only this setup allows my
:admin
to both:read
and:edit
Merchants.Can you please check what could be the reason? I can provide any additional details that you may require. Thanks.