class ZMSImpl implements Authorizer, KeyStore, ZMSHandler {

    boolean matchPrincipalInRole(Role role, String roleName, String fullUser, String trustDomain) {

        // if we have members in the role then we're going to check
        // against that list only

        if (role.getRoleMembers() != null) {
            return isMemberOfRole(role, fullUser);
        }

        // no members so let's check if this is a trust domain

        String trust = role.getTrust();
        if (!AuthzHelper.shouldRunDelegatedTrustCheck(trust, trustDomain)) {
            return false;
        }

        // delegate to another domain.

        if (LOG.isDebugEnabled()) {
            LOG.debug("matchPrincipal: [delegated trust. Checking with: " + trust + "]");
        }

        return delegatedTrust(trust, roleName, fullUser);
    }

    public  ZMSImpl();

}