The hasRole() method is for checking if the currently logged in user has a specific role. It accepts one argument (the name of the role to check that the user has, and returns a boolean value indicating whether the user has the specified role or not).