Fixes #5221: Adds a helper method to allow a model instance to inquire if 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.
Related issues
Feature #5221: Foreman should provide a helper method to allow an instance of a model to ask if the instance is authorized for a given permission.
Fixes #5221: Adds a helper method to allow a model instance to inquire if 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.