code: public boolean isUserInRole(String role)
      {
          Principal principal = getUserPrincipal();
          if (principal != null)
          {
              UserRealm realm = getHttpResponse().getHttpContext().getRealm();
              if (realm != null) return realm.isUserInRole(principal, role);
          }
          return false;
      }
docs: /* ------------------------------------------------------------