private boolean inGroup(final UserRef userRef,
                          final String groupName,
                          final Set<UserRef> examined) {
        final Set<UserRef> userGroups = userGroupsCache.getGroups(userRef);
        if (userGroups != null) {
            for (final UserRef userGroup : userGroups) {
                if (userGroup.getSubjectId().equals(groupName)) {
                    return true;
                }

                // Recurse into parent groups.
                if (!examined.contains(userGroup)) {
                    examined.add(userGroup);
                    if (inGroup(userGroup, groupName, examined)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
Run the supplied code regardless of whether there is a current user and also allow all inner code to run
insecurely even if it is often secured when executed from other entry points.
stroom-security/stroom-security-impl/src/main/java/stroom/security/impl/SecurityContextImpl.java