code: public boolean hasPermission(Authentication authentication,
                                   Object privilege) {
          return checkRole(authentication, privilege, true)
              || checkPermission(authentication, null, privilege, false, true);
      }
docs: Check permission for role and privilege key only.
  @param authentication the authentication
  @param privilege the privilege key
  @return true if permitted