Checking the required role to restrict unauthorized roles.