class AuthServicePluginUtils {

	public static RoleFilter createRoleFilter(List<RoleResponse> roles, List<GroupResponse> groups) {
		Set<String> allowed = new HashSet<>();
		groups.forEach(g -> {
			g.getRoles().forEach(r -> {
				allowed.add(r.getName() + "-" + g.getName());
			});
		});
		roles.forEach(r -> {
			r.getGroups().forEach(g -> {
				allowed.add(r.getName() + "-" + g.getName());
			});
		});
		return (groupName, roleName) -> {
			return !allowed.contains(roleName + "-" + groupName);
		};
	}

	private  AuthServicePluginUtils();

}