We created a method named
editor? that checks whether a user's role is "editor", and returns
false. The method uses
self to refer to the current instance of a User object.
Now that we can determine whether a user has an editor role on the site, let's add a few methods to the Application controller (app/controllers/application_controller.rb) to make sure that users with the editor role can access specific parts of the site.