class AuthzHelper {

    public static boolean matchDelegatedTrustPolicy(Policy policy, final String roleName, final String roleMember,
                                                    List<Role> roles, GroupMembersFetcher groupMembersFetcher) {

        List<Assertion> assertions = policy.getAssertions();
        if (assertions == null) {
            return false;
        }

        for (Assertion assertion : assertions) {
            if (matchDelegatedTrustAssertion(assertion, roleName, roleMember, roles, groupMembersFetcher)) {
                return true;
            }
        }

        return false;
    }

}