How is DLS applied when user has multiple roles

In case anybody interested, this workaround broke index pattern update, Weird error when trying to update index pattern - #4 by rlevitsky