theforeman/foreman — pull request #1384 by ehelms (2014-04-17 03:22:06+00:00)
Title: Fixes #5221: Adds a helper method to allow a model instance to inquire i...

...f the instance is authorized for a particular permission.

Model instances can be asked directly if they are authorized for a particular
permission by, for example, calling 'instance.authorized?(:view_model)'. This
abstracts and centralizes some of the repetitiveness of having to instantiate
an authorizer and pass the instance to the 'can?' method as the object of inquiry.