Hi guys.
I'm trying to use cancan for authorization and now I have two rules for a single subject: first checks that user owns subject instance and second that user has paid subscription. How can I understand what rule was used to deny access? I need that to show relevant message to user.
I think it could be useful to add some key into 'can' and 'cannot' methods, so that it will give us ability to distinguish different cases.
For example:
can :read, Article, reason: :why_access_denied do |article|
#some checks here
end
Thank you in advance.