code: public boolean hasCurrentUserGotRoleForDomain(Role role, String domain) {
          try {
              DomainRoleEntryEntity domainRoleEntry = findByUserIdAndRole(joynrCallingPrincipal.getUsername(), role);
              return domainRoleEntry != null && domainRoleEntry.getDomains().contains(domain);
          } catch (ContextNotActiveException e) {
              logger.debug("No joynr message scope context active. Defaulting to 'true'.");
          }
          return true;
      }
docs: Determine whether the joynr calling principal, if available, has the given role for the given domain.
  The result will default to <code>true</code> if there is no current user - that is, the call is being
  made from without of a {@link io.joynr.jeeintegration.api.JoynrJeeMessageScoped joynr calling scope}.
  This way, the bean functionality can be used to create an admin API which doesn't require a user to
  be already available in the database, e.g. for initial creation of security settings or providing a
  RESTful API which is secured by other means.
  
  @param role the role the user should have.
  @param domain the domain for which the current user must have the role.
  @return <code>true</code> if there is a current user, and that user has the specified role in the given
  domain, <code>false</code> if there is a current user and they don't. <code>true</code> if there is no
  current user.